Jump to content

[1.9]BiomeGenBase.BiomeProperties dosen't let you use the methods in it.


Recommended Posts

Posted

I'm adding in a biome for my dimension and when I try to do the same thing that BiomeGenBase does when registering there biomes It gives me an error stating that the methods in BiomeProperties are not visible. This is my biome class:

package com.moreoresmod.main.init;

import net.minecraft.init.Bootstrap;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenOcean;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeManager.BiomeEntry;
import net.minecraftforge.common.BiomeManager.BiomeType;

import com.moreoresmod.main.biomes.BiomeGenOtherlyworld;

public class MoreOresModBiomes {

public static final BiomeGenBase otherlyworldBiome;

private static BiomeGenBase.BiomeProperties otherlyworldProperties = new BiomeGenBase.BiomeProperties("Otherlyworld");

public static int lastBiomeID = 0;

static{
	if(!Bootstrap.isRegistered()){
		throw new RuntimeException("Accessed Biomes before Bootstrap!");
	}else{
		otherlyworldBiome = getRegisteredBiome("otherlyworld");
	}
}

public static void init(){

	BiomeGenBase.registerBiome(90, "otherlyworld", new BiomeGenOtherlyworld((new BiomeGenBase.BiomeProperties("Otherlyworld")).setSnowEnabled().setTemperature(0F).setWaterColor(000000)));

	//otherlyworldBiome = new BiomeGenOtherlyworld((new BiomeGenBase.BiomeProperties("Otherlyworld")));
	//BiomeEntry entry_otherlyworld = new BiomeEntry(otherlyworldBiome, 20);
	//BiomeManager.addBiome(BiomeType.WARM, entry_otherlyworld);
	//BiomeManager.addSpawnBiome(otherlyworldBiome);
}

private static BiomeGenBase getRegisteredBiome(String id)
    {
        BiomeGenBase biomegenbase = (BiomeGenBase)BiomeGenBase.biomeRegistry.getObject(new ResourceLocation(id));

        if (biomegenbase == null)
        {
            throw new IllegalStateException("Invalid Biome requested: " + id);
        }
        else
        {
            return biomegenbase;
        }
    }

}

Posted

I did, I gave you a direct link to the file and said "Look at PropsBuilder and BiomeProps" That's all the code you need. You then register your biome like

new YourBiome((new PropsBuilder("Biome Name")).withRainfall().<allMethodsYouWantToUse>().build());

Posted

PropsBuilder and BiomeProps are defined in that class file, so NO, you cannot just import them.

Go look at them. They are near the bottom (look at BiomeProps in particular).

Posted

You can import it it's a public class.

anyways.. could be fixed with a simple PR to change those methods from protected to public. So that the class can be used outside of the BiomeGenBase class/SubClasses.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

What does PR stand for?

 

Pull Request. You can see the guidelines for contributing to Forge here.

 

It looks like Lex just made this change himself, so there's no need for a PR now.

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.

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.