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

[1.12.2] Create custom Ocean Biome


Meldexun
 Share

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



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • i saw this in a mod(the code is written in 1.16.5) but is giving me erros, it doesnt find player.playerInfo and playerInfo.playerTexturesLoaded, in the class that was made it doesnt extends anything public static void setPlayerSkin(AbstractClientPlayerEntity player, ResourceLocation texture) { if (player.getLocationSkin().equals(texture)) { return; } NetworkPlayerInfo playerInfo = player.playerInfo; if (playerInfo == null) return; Map<MinecraftProfileTexture.Type, ResourceLocation> playerTextures = playerInfo.playerTextures; playerTextures.put(MinecraftProfileTexture.Type.SKIN, texture); if (texture == null) { playerInfo.playerTexturesLoaded = false; } }  
    • Hi and first of all thanks in advance! I am currently trying to write a mod for Forge 1.18.1 (and upwards, maybe even backport) that needs to load a mod jarfile from a subfolder and I found the net.minecraftforge.fml.ModLoader package/class which I imported in hopes of being able to just queue the jarfile with this I have found this text when hovering over the ModLoader class: but I can't find any information online on what the # in #loadMods could stand for and or how I would use the class. I am pretty new to java and using eclipse tho I think I found my way around things by now! I have previously programmed in several C derivatives but Java is my first object oriented language. If you could help me find the right ressources and / or tell me how to use ModLoader to load a .jar file (I have the surrounding structure for finding the folder etc. already written) I would really appreciate that! Again, thanks in advance - looking forward to getting help :) ~Chaos_02
    • Register your own IRecipeSerializer. It is registered like any other registry entry. However note that you should have as much as possible in the JSON. Don't just have a placeholder JSON file and then hardcode all the logic in code. That defeats the point of datapacks. You'll have to have your own repair recipe then (see above for how to make your own serializer) and override getRemainingItems. If the knife is your item, override hasContainerItem and getContainerItem in your Item class. If the knife is not your item, refer to the section about repairing. Use a GlobalLootModifier.
    • So, im kinda new to modding. Trying to make relatively complicated mod(as I see now, it breaks the api a little bit...), and faced into some problems, especially with crafting. I think I should tell a little bit about my mod, you actually can skip this part, but if you don't get something, i strongly suggest to read this part. The goal i'm chasing is to implement similar food mechanics to TFC classic(1.7.10) mechanics. In a nutshell, it's food with durrability, and when you eat, you consume as much as you need(like if you have a steak and 1 hunger, if you eat it, stake's potential wastes, in case of my mod, it shouldn't). That's it, that's already done(with little bugs thou, but done). Now I have to do crafting somehow, using that items and modify durability while crafting. And it doesn't seems to be easy.     And.. question 1 will be: is it possible to hardcode crafts in 1.16.5? I know.. it's kinda not beautifull, but I really hate the json system. I've made as much crafts as possible by using it, but now, when I need to implement some logic, it's such a headache.   2. This question is about repearing. I mean, placing two damaged items in recipe grid. If you add 2 8/10 items, you'll get just one 10/10 item, and nothing more. I'd like 6/10 item to apear in grid after crafting. 3. Also there should be a recipe for extracting seeds with knife(i don't like to loose knife and whole peace of crop after craft). 4. And the last one. Well, I should change drop of crops if it's broken by special tool. I know, it's possible to do it by adding harvest tools, but I can't modify vanilla crops(maybe only by reflection..). Seems like it's reasonable to use onBlockBroken event, or something like that, but I keep finding deprecated code examples in google, and it doesn't work for me. Maybe there is a better solution.   About crafts.. I tried to figure out how CraftSerializers works, and i think it might be a good solution for that crafting stuff. But don't understand how to bind the serializer to regular minecraft crafting. Tried to read ShapelessRecipe class, but don't understand what happens in mathes, so cant do any assumptions how should I modify it. 
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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