Jump to content

[1.12.2] Create custom Ocean Biome


Meldexun

Recommended Posts

I have created a new Biome and now I want to make it spawn with a ocean biome around it. Or at least next to my biome should be a ocean biome.

So this is what I'm doing when registering my biome:

	@SubscribeEvent
	public static void registerBiome(RegistryEvent.Register<Biome> event) {
		event.getRegistry().register(kelpForest);
		BiomeDictionary.addTypes(kelpForest, Type.OCEAN);
		BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 20));
		BiomeManager.addSpawnBiome(kelpForest);
	}

But it seems that it just randomly spawns.

Edited by Meldexun
Link to comment
Share on other sites

Ok i found out that minecraft spawns Biome Types (Warm, Cold, Icy or Desert).

So with this when minecraft is spawning a Warm biome my biome has a chance to be generated.

BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 20));

But there is no Biome Type Ocean. Does nobody know how I can register and generate it as a Ocean biome?

Link to comment
Share on other sites

Here's how the deep ocean (an ocean sub-biome) gets registered:
 

registerBiome(24, "deep_ocean", new BiomeOcean((new Biome.BiomeProperties("Deep Ocean")).setBaseHeight(-1.8F).setHeightVariation(0.1F)));

 

I actually haven't done anything with biomes so far, but I'm pretty sure you can apply part of this.  If I had to guess, I'd say any height less than 0 is underwater.

Link to comment
Share on other sites

2 minutes ago, Laike_Endaril said:

Here's how the deep ocean (an ocean sub-biome) gets registered:
 


registerBiome(24, "deep_ocean", new BiomeOcean((new Biome.BiomeProperties("Deep Ocean")).setBaseHeight(-1.8F).setHeightVariation(0.1F)));

 

I actually haven't done anything with biomes so far, but I'm pretty sure you can apply part of this.  If I had to guess, I'd say any height less than 0 is underwater.

I'm registering my biome correctly. So it is spawning as a ocean biome with water and so on. But Minecraft generates Biome Types (warm,...) and if i use this:

BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 20));

When a warm biome type generates my biome has a chance to appear. But I want my biome to spawn when a ocean biome is generated and not when a warm biome is generated.

Link to comment
Share on other sites

Just now, Laike_Endaril said:

Does your biome class extend BiomeOcean?  Does your biome set its height?

You should post your class code and the code where you declare/initialize the field "kelpForest" so ppl can get a better idea of what may be wrong.

Ok. I will post my code tomorrow. It's to late for me now.

Link to comment
Share on other sites

19 hours ago, Laike_Endaril said:

Does your biome class extend BiomeOcean?  Does your biome set its height?

You should post your class code and the code where you declare/initialize the field "kelpForest" so ppl can get a better idea of what may be wrong.

So here are my full classes.

@EventBusSubscriber
public class InitBiome {

	public static Biome kelpForest;
	
	@SubscribeEvent
	public static void registerBiome(RegistryEvent.Register<Biome> event) {
		kelpForest = new KelpForest().setRegistryName(BetterDiving.modid, "Kelp Forest");
		event.getRegistry().register(kelpForest);
		BiomeDictionary.addTypes(kelpForest, Type.OCEAN, Type.WATER);
		BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(kelpForest, 10));
	}

}

 

And my Biome class

public class KelpForest extends Biome {

	public KelpForest() {
		super(new BiomeProperties("Kelp Forest").setBaseHeight(-1.5f).setHeightVariation(0.05f).setWaterColor(8257405).setBaseBiome("ocean"));
		this.spawnableCreatureList.clear();
		
		topBlock = Blocks.SAND.getStateFromMeta(0);
		fillerBlock = Blocks.SAND.getStateFromMeta(0);
		
		this.decorator.clayGen = null;
		this.decorator.sandGen = null;
		this.decorator.gravelGen = null;
		this.decorator.dirtGen = null;
		this.decorator.gravelOreGen = null;
		this.decorator.graniteGen = null;
		this.decorator.dioriteGen = null;
		this.decorator.andesiteGen = null;
		this.decorator.flowerGen = null;
		this.decorator.mushroomBrownGen = null;
		this.decorator.mushroomRedGen = null;
		this.decorator.bigMushroomGen = null;
		this.decorator.reedGen = null;
		this.decorator.cactusGen = null;
		this.decorator.waterlilyGen = null;
		this.decorator.waterlilyPerChunk = 0;
		this.decorator.treesPerChunk = 0;
		this.decorator.extraTreeChance = 0;
		this.decorator.flowersPerChunk = 0;
		this.decorator.grassPerChunk = 0;
		this.decorator.deadBushPerChunk = 0;
		this.decorator.mushroomsPerChunk = 0;
		this.decorator.reedsPerChunk = 0;
		this.decorator.cactiPerChunk = 0;
		this.decorator.gravelPatchesPerChunk = 0;
		this.decorator.sandPatchesPerChunk = 0;
		this.decorator.clayPerChunk = 0;
		this.decorator.bigMushroomsPerChunk = 0;
		this.decorator.generateFalls = false;
		
	}

	@Override
	public Biome.TempCategory getTempCategory() {
		return Biome.TempCategory.OCEAN;
	}
	
	@Override
	public BiomeDecorator getModdedBiomeDecorator(BiomeDecorator original) {
		return new DecoratorKelpForest();
	}
}

 

Link to comment
Share on other sites

It may not be extending OceanBiome directly, but the only reason I mentioned that was for getTempCategory(), which you're already overriding with the same return, so I don't think that's the issue (unless MC is checking class inheritance for biomes somewhere, but I doubt it).


I'll try tinkering with it a bit and see if I learn anything.

Link to comment
Share on other sites

Unfortunately I have had no luck.  I've been using the Nature's Compass mod to help debug, and by default I get the same behavior you do.

 

If I add the kelp forest biome to BiomeManage.oceanBiomes then it does not generate at all afaik.  I feel like this step is necessary but something is missing; probably something difficult to figure out.

 

I don't think I can be of much help here, but if you can do this using structure gen instead of biome gen, you may want to look into that approach as it may be more workable (after all, structures generate inside specified biomes; you could use the ocean monument as reference if you did it this way)

Link to comment
Share on other sites

Hey, could you post your kelp decorator please? I've been seeing the modded decorator for awhile and not been sure how to correctly implement one, as well as not really seen anyone show how to correctly use it and would love to get an idea!

Also i've been looking into Sub-Biomes and ocean biomes too because my mod that i'm updating has a coral reef biome, i'd love to have as a sub biome instead of a random biome that spawns in general! So if you get it working i'd love to know and i'll do likewise for you! :)

Link to comment
Share on other sites

3 hours ago, Zathrox said:

Hey, could you post your kelp decorator please? I've been seeing the modded decorator for awhile and not been sure how to correctly implement one, as well as not really seen anyone show how to correctly use it and would love to get an idea!

Also i've been looking into Sub-Biomes and ocean biomes too because my mod that i'm updating has a coral reef biome, i'd love to have as a sub biome instead of a random biome that spawns in general! So if you get it working i'd love to know and i'll do likewise for you! :)

I'm sorry but I lost some files. So I can't send you any example.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • So i know for a fact this has been asked before but Render stuff troubles me a little and i didnt find any answer for recent version. I have a custom nausea effect. Currently i add both my nausea effect and the vanilla one for the effect. But the problem is that when I open the inventory, both are listed, while I'd only want mine to show up (both in the inv and on the GUI)   I've arrived to the GameRender (on joined/net/minecraft/client) and also found shaders on client-extra/assets/minecraft/shaders/post and client-extra/assets/minecraft/shaders/program but I'm lost. I understand that its like a regular screen, where I'd render stuff "over" the game depending on data on the server, but If someone could point to the right client and server classes that i can read to see how i can manage this or any tip would be apreciated
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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