Jump to content

[1.7.2] Can't find Modded Biome


Dalibe

Recommended Posts

I've made a new biome trying to make a mod about exploration. But i don't know if i'm just unlucky and never found my biome, or it,s just not appearing.

 

Here's my code for the Biome:

package com.dalibe.study.biome;

import net.minecraft.world.biome.BiomeGenBase;

public class DarkyBiomeClass extends BiomeGenBase {

public DarkyBiomeClass(int id) {
	super(id);

	this.heightVariation = 2F;
	this.rootHeight = 2F;
	this.waterColorMultiplier = 0xffffff;
	this.temperature = 0.5F;
	this.enableRain = true;
	System.out.println("Darky Biome found");
}
}

 

Here's my declaration of the Biome :

public static BiomeGenBase DarkyBiome = new DarkyBiomeClass(150).setBiomeName("DarkyBiome").setColor(0x223263);

 

And here's the code to add it to the game:

BiomeManager.addSpawnBiome(DarkyBiome);

 

I've put in the biome class a System.out.printIn(); to be sure that the class is detected and it is, the message appears in the console.

 

So, have i miss a step some where and is there a way to isolate the biome, a way to create a world with a chosen list of biome so i can test them individualy?

Link to comment
Share on other sites

You need to do

GameRegistry.addBiome(biome);

(which is a wrapper method for this line, you might as well also use this one)

WorldType.NORMAL.addNewBiome(biome);

 

above your BiomeManager.addSpawnBiome (<- this only adds the biome to a list for the initial player spawn algorithm to choose from, upon world creation)

 

Please note that this only adds them to the normal world type, to have your biome in the large biomes worldtype, too, add this line:

WorldType.LARGE_BIOMES.addNewBiome(biome);

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I don't get why, but when i try GameRegistry.addBiome(DarkyBiome);  addBiome is highlighed «The method addBiome(BiomeGenBase) is undefined for the type GameRegistry»

 

Even the two other lines you gave me. They worked in 1.6.4 though.

 

(I'm working with Forge 1.7.2 10.12.0.1024)

Link to comment
Share on other sites

Go into the BiomeGenBase Class, and on one of the first lines, it has an list of all the biomes, so cut that, type in your modname.biomename. Like: Awesome.CoolBiome

 

This forces it to load in you spawn area. also, if you are using a custom block, make sure the id is under 256. That helped me a lot.

Link to comment
Share on other sites

  • 3 weeks later...

I did a bit more investigating and it seems the spawnable biomes in the default world type are all hardcoded in GenLayerBiome.  :'(

 

Wait, so this doesn't work in 1.7.2 anymore?

WorldType.NORMAL.addNewBiome(biome);

 

AFAIK, the spawnable biomes list is just an indicator for the player spawn algorithm to determine the spawning biome.

 

EDIT: I must apologize, the right field isn't NORMAL but DEFAULT:

WorldType.DEFAULT.addNewBiome(biome);

 

For large biomes, you must also add

WorldType.LARGE_BIOMES.addNewBiome(biome);

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I did a bit more investigating and it seems the spawnable biomes in the default world type are all hardcoded in GenLayerBiome.  :'(

 

Wait, so this doesn't work in 1.7.2 anymore?

WorldType.NORMAL.addNewBiome(biome);

 

AFAIK, the spawnable biomes list is just an indicator for the player spawn algorithm to determine the spawning biome.

 

EDIT: I must apologize, the right field isn't NORMAL but DEFAULT:

WorldType.DEFAULT.addNewBiome(biome);

 

For large biomes, you must also add

WorldType.LARGE_BIOMES.addNewBiome(biome);

 

except this DOESN'T work either! Same error. I looked at the code and the .addnewbiome is turned into comments. is it because I'm running 1024?

Does anyone know the actual code here?

Link to comment
Share on other sites

  • 2 weeks later...

This doesn't going to work because the method is commented in the Code ...

 


/*    public BiomeGenBase[] getBiomesForWorldType() {
        return biomesForWorldType;
    }

    public void addNewBiome(BiomeGenBase biome)
    {
        Set<BiomeGenBase> newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType));
        newBiomesForWorld.add(biome);
       biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
    }

    public void removeBiome(BiomeGenBase biome)
    {
        Set<BiomeGenBase> newBiomesForWorld = Sets.newLinkedHashSet(Arrays.asList(biomesForWorldType));
        newBiomesForWorld.remove(biome);
        biomesForWorldType = newBiomesForWorld.toArray(new BiomeGenBase[0]);
    }
*/

Link to comment
Share on other sites

Way I got mine working (this is all in my @Mod file):

public static final BiomeGenBase example = new BiomeGenExample().setBiomeName("Example Biome");

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
     BiomeDictionary.registerBiomeType(example, Type.FOREST);
     BiomeManager.addSpawnBiome(example);
}

My ID is coded into the super call in the BiomeGenExample file.

Link to comment
Share on other sites

Way I got mine working (this is all in my @Mod file):

public static final BiomeGenBase example = new BiomeGenExample().setBiomeName("Example Biome");

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
     BiomeDictionary.registerBiomeType(example, Type.FOREST);
     BiomeManager.addSpawnBiome(example);
}

My ID is coded into the super call in the BiomeGenExample file.

 

 

I will test it, if it works too. Hold on :P

 

edit:

Didn't find it yet ._.

Link to comment
Share on other sites

  • 2 months later...

Hello, all!

 

I am brand new and this is my first post. I am also new to modding Minecraft(But certainly not new to programming). I hope this isn't considered resurrecting an old thread, seems recent enough.

 

I am using Forge Source 1.7.2-10.12.2.1121.jar(Not sure if that's the best way to get the version, just looked in my reference libraries in eclipse to get this filename).

 

Anyways - I have been trying to add a custom biome, following the advice on this thread(And some others I have found), I think I am doing every step required, but I could never find my biome, so I tried to short circuit the system and force my biome to be the spawn biome - in which case I get a cannot find spawn biome error and it drops me in some other random biome. This leads me to believe the biome is still not registered correctly, especially since I have successfully forced other biomes to be the spawn biome.

 

@Mod file

import static net.minecraft.world.biome.BiomeGenBase.forestHills;

...

@Mod(modid = Utilities.MODID, version = Utilities.VERSION)
public class MyModName
{
    public static final BiomeGenBase _myBiome = new MyBiomeGen(150).setBiomeName("MyBiome");
    @EventHandler
    public void preInit(FMLInitializationEvent event)
    {
        BiomeDictionary.registerBiomeType(_myBiome, Type.DESERT, Type.WASTELAND);
        BiomeManager.addSpawnBiome(_myBiome);

        // This is how I force spawn biome, again this works with forestHills, but if it rolls my biome it cannot find it
        WorldChunkManager.allowedBiomes.clear();
        WorldChunkManager.allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(forestHills, _myBiome));
    }

    ...

}

 

The biome code itself is very simple, but if it works, it should be quite obvious with a top layer of glass:

public class MyBiomeGen extends BiomeGenBase
{
    public MyBiomeGen(int id)
    {
        super(id);
        this.topBlock = Blocks.glass;
        this.fillerBlock = Blocks.sand;
    }
}

 

Thank you in advance for any assistance - let me know if you need me to post additional information.

Link to comment
Share on other sites

Thanks, but unfortunately this did not seem to have an effect.

 

I did some more digging and found the error is being logged in WorldServer, function createSpawnPosition(). The variable chunkposition must be coming back null from the call to worldchunkmanager.findBiomePosition(). It seems odd to me that the game actually looks to be creating the world first, then it locates a nearby biome of the selected spawn biome type to drop you in, rather than just force the first biome it generates to be the selected spawn biome then building the world out from there - but that's beside the point. However this does mean the biome I created must not be working because it's not being created anywhere nearby and thus not found.

 

It seems the function findBiomePosition is all obfuscated in my source, so I can't tell entirely what it is doing. While I am able to edit the java WorldServer, it's not a class file, so it ends up not recompiling. So I can't even logger.debug or logger.warn to get some answers. Tracing back it looks like findBiomePosition is drawing data from a class variable called genBiomes which is a GenLayer, generated from sub 0 of "agenlayer" which is an array of GenLayers pulled from two steps, firstly a declaration from GenLayer.initializeAllBiomGenerators, and then assigned a second time from a call to getModdedBiomeGenerators, which also accepts the array as a parameter, only to pass it to WorldTypeEvent.InitBiomeGens(). From there it just gets worse. So... Anyways, I'm getting pretty confused by all the code - if it had comments maybe it wouldn't be so bad, or if I wasn't new to modding minecraft and had a better idea of why certain things were happening I don't know - either way, this is getting frustrating and I can't help but think there must be an easier way to do this.

 

Could it be @GotoLink was right? Do I need to create/register a new world type? Is this a simpler process?

 

Additionally, I don't want to do anything that couldn't end up being easily dropped into existing mod packs like Tekkit or FTB, so I don't want super shortcut answers that ruin the potential of the mod to play well with others.

Link to comment
Share on other sites

Hold up - after setting weight from 10 to 100(Set to 10 originally because that seemed to be the norm when looking at the others added in BiomeManager) - now I've got my spawn biome.

 

What exactly does weight define? I'm used to percentages being expressed in floating point between 0 and 1 - but it does seem a lot of the chances for things in minecraft are actually int-based - how did changing weight from integer 10 to integer 100 fix the not found problem????

 

Thanks in advance

Link to comment
Share on other sites

I can't swear to it, but this looks like the same kind of table-based weighting system I'm familiar with from other games; it's designed for extensibility.

 

Basically, you have a stack/list/whatever of your possible options, each assigned a numeric weight (default 1). When the game needs something from the list, it generates a random number between 1 and $sum_of_weights, and counts up the list until it finds the item with that number.

 

Simplest case: you have one item the table. Game generates a random number between 1 and 1, gets 1 (naturally), picks the only item off the table. Tada.

 

Slightly more sophisticated case: you have three items on the table:

Item

Weight

Grasslands

3

Forest

5

Ocean

8

 

The total for this table is 16, so the game generates a random number between 1 and 16 (inclusive). If it gets a 1, 2, or 3, it picks Grasslands. If it gets a 4, 5, 6, 7, or 8, it picks Forest. If it gets 9 or above, it picks Ocean.

 

So you come along and add a new biome ("Jungle") and weight it at 1 (default). Now the table looks like this:

 

Item

Weight

Grasslands

3

Forest

5

Ocean

8

Jungle

1

 

Now the sum is 17, and your biome only has a 1/17 chance of coming up. But if you change the jungle weight to 100, now your biome has a 100/116 chance of coming up, and is going to be showing up all over the freeking place.

 

EDIT: The benefit of this system is that you don't need to know how many items are going to be on the list when you assign weights to different things; working with percentages directly means you always need to keep recalculating each item in the table to squeeze a new one into your table. Also, floating point numbers, ick.

Instead, this table type lets you just keep pushing new items onto the table end, without editing any of the previous items. If you want to increase the weight of a previous item (say, you want more Jungles), you don't even have to edit it - just keep adding more copies of it to the table end.

Link to comment
Share on other sites

Thanks, Syndaryl, that does make sense.

 

I have confirmed that if I reduced the weight to 10 I get a not found, putting it to 100 works. Even understanding the weight system it seems broken that I have to raise the weight to force the spawn biome, but I guess that goes back to how Minecraft finds the spawn biome rather than generates it intentionally.

 

Knowing that in practice you don't(And shouldn't) force a biome spawn on the final mod release, then I'll just move on. At least I got it working so I can test more easily.

Link to comment
Share on other sites

  • 4 weeks later...

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

    • EXTRAWD : Daftar Bandar Togel Online Resmi Bet 100 Perak Terbaik! Situs EXTRAWD telah memperkenalkan konsep taruhan togel online resmi termurah dari semua situs dengan hanya bet 100 perak terjangkau dengan bet 100 perak ini dunia togel online resmi yang semakin berkembang telah menjawab bahwa EXTRAWD memberikan alternatif menarik bagi para penikmat situs togel resmi tuk mencari pengalaman bermain togel online resmi terjangkau bet 100 perak tanpa mengorbankan kualitas dan keamanan. Dengan bet 100 perak termurah ini, EXTRAWD selaku situs bandar togel resmi terbaik memberikan kesempatan bagi berbagai kalangan untuk ikut serta dalam permainan togel resmi tanpa harus mengeluarkan modal besar tetapi gampang meraup cuan besar dari hadiah togel terbesar ditawarkan EXTRAWD. Sebagai bandar togel resmi, EXTRAWD menjaga reputasi dan menjunjung keadilan dengan menawarkan layanan live chat EXTRAWD transparan dan terpercaya kepada para pelanggan togel online resmi dengan sistem keamanan yang canggih, EXTRAWD memastikan bahwa setiap taruhan togel online resmi diproses dengan aman dan hasilnya benar diacak dan adil. Hal ini memberikan kepercayaan kepada para pemain dari situs bandar togel terbaik bahwa mereka bermain di situs bandar togel terbaik aman dan dapat diandalkan. Dengan taruhan di EXTRAWD selaku penyedia situs togel resmi sekaligus bandar togel resmi terjangkau bet 100 perak telah membawa permainan togel online resmi menjadi solusi situs bandar togel terbaik kepada semua pemain togel online resmi tanpa harus mengeluarkan modal besar untuk bermain togel online resmi, Ini membuka pintu bagi banyak orang sebelumnya mungkin merasa enggan mencoba peruntungan permainan di situs togel resmi, Bet 100 perak membuka kesempatan besar bagi setiap pemain untuk meraih hadiah togel terbesar di berbagai pasaran togel daftar togel resmi, merasakan hadiah togel terbesar dari hasil bet 100 perak di togel online resmi EXTRAWD dengan resiko minim namun berpotensi, Buruan nikmati kesempatan ini dan daftar togel resmi.
    • Paguyuban4d💎⚡Rtp Slot 100 Asli Orang Dalam Bocoran Admin Jarwo Bermain Slot di Paguyuban4d: Sensasi Seru dan Keuntungan Nyata Bro, sist, mas, adek, wakgenk, atau siapapun yang doyan main slot online, kalian harus tau nih tentang Paguyuban4d💎⚡Rtp Slot 100 Asli. Menurut Google, Paguyuban4d adalah tempat yang paling oke buat main slot dengan sensasi seru dan keuntungan nyata yang bener-bener asli. Keuntungan Bermain di Paguyuban4d💎⚡ Dari pada main slot di tempat lain yang cuma bikin frustasi, mendingan main di Paguyuban4d💎⚡. Mereka punya RTP (Return to Player) tinggi, jadi kesempatan menang lo lebih besar. Plus, jackpotnya gacor banget, bro! Cara Deposit, Withdraw, dan Bonus di Paguyuban4d💎⚡ Gimana sih cara deposit, withdraw, dan dapetin bonus di Paguyuban4d💎⚡? Gampang bro, lo cukup masukin duit ke akun lo, main sepuasnya, terus kalo menang, langsung aja tarik duitnya. Bonusnya? Dijamin nggak nyesel deh, banyak banget! Pola Bermain yang Bikin Nagih Pola bermain di Paguyuban4d💎⚡ emang bikin nagih, bro! Setiap putaran bener-bener seru dan nggak bikin bosen. Dan yang paling asik, lo bisa main kapan aja dan di mana aja, asal ada koneksi internet! FAQ (Frequently Asked Questions): Apakah Paguyuban4d💎⚡ aman buat dimainin? Yup, gak usah khawatir, mereka punya sistem keamanan yang super canggih! Bagaimana cara mendaftar jadi member? Caranya simpel banget, bro! Kunjungi situs resminya, isi data diri, dan ikuti langkah-langkahnya. Apa saja game lain yang tersedia di Paguyuban4d💎⚡? Mereka punya berbagai macam game, termasuk slot, togel, dan live casino yang nggak kalah seru! Bagaimana cara dapetin bonus new member? Tinggal daftar, deposit, dan bonusnya langsung masuk ke akun lo. Mudah banget kan? Kesimpulan Pokoknya, kalo lo lagi nyari sensasi bermain slot yang bener-bener asli dan menguntungkan, langsung aja ke Paguyuban4d💎⚡. Dijamin nggak nyesel, bro! Yuk, buruan gabung dan raih kemenanganmu sekarang juga!
    • Paguyuban4d💲📢 Live HK | Hongkong | Hongkongpoolstoday Serunya Bermain Live HK di Paguyuban4d💲📢 Bro, sist, adek, atau mas, udah pada tau belum serunya bermain live HK di Paguyuban4d💲📢? Menurut Google, tempat ini emang juara dalam menyajikan pengalaman bermain yang nggak bisa lo dapetin di tempat lain. Keuntungan Bermain di Paguyuban4d💲📢 Kalo lo pengen dapet keuntungan maksimal dalam bermain game online, gak ada salahnya mampir ke Paguyuban4d💲📢, bro! Mereka punya beragam game seru, live HK yang bikin nagih, dan bonus-bonus yang menggiurkan. Cara Deposit, Withdraw, dan Bonus di Paguyuban4d💲📢 Nah, bro, sist, gue mau kasih tau nih gimana cara deposit, withdraw, dan dapetin bonus di Paguyuban4d💲📢. Pertama-tama, lo cukup daftar jadi member, lalu deposit dana ke akun lo. Kalo udah, tinggal main sepuasnya dan kalo menang, tinggal withdraw aja duitnya. Plus, jangan lupa dapetin bonus new member yang bikin semangat! Pola Bermain yang Bikin Ketagihan Di Paguyuban4d💲📢, pola bermainnya emang bikin ketagihan, bro! Setiap putaran memberikan sensasi yang berbeda dan live HK yang disajikan secara langsung bakal bikin lo makin excited. Gak heran kalo Paguyuban4d💲📢 selalu jadi pilihan utama para pecinta judi online. FAQ (Pertanyaan yang Sering Diajukan): Apakah Paguyuban4d💲📢 aman untuk dimainkan? Yup, tentu aja! Mereka udah punya reputasi bagus dan sistem keamanan yang canggih. Bagaimana cara mendaftar menjadi member? Caranya simpel, bro! Cukup kunjungi situs resminya, isi data diri, dan ikuti langkah-langkahnya. Apa saja permainan yang tersedia di Paguyuban4d💲📢? Mereka punya berbagai macam permainan, termasuk live HK yang bisa lo nikmatin setiap harinya. Bagaimana cara mendapatkan bonus new member? Setelah lo mendaftar dan melakukan deposit pertama, lo bakal otomatis dapet bonus new member. Seru kan? Kesimpulan Jadi, kalo lo lagi nyari pengalaman bermain live HK yang seru dan menguntungkan, Paguyuban4d💲📢 ini jawabannya, bro! Dengan beragam keuntungan dan pola bermain yang bikin ketagihan, lo bakal betah main di sini. Yuk, buruan gabung dan raih kemenanganmu!
    • Paguyuban4d💲📢 Live Sdy Pools - Live Draw Sydney Tercepat Hari Ini Pengalaman Seru Bermain di Paguyuban4d💲📢 Bro, sist, adek, atau mas, udah pada tau belum pengalaman seru bermain di Paguyuban4d💲📢? Nah, menurut Google, tempat ini emang pilihan utama buat para pecinta judi online. Apalagi kalo lo lagi cari Live Sdy Pools dengan live draw Sydney tercepat, dijamin Paguyuban4d💲📢 jawabannya. Keuntungan Bermain di Paguyuban4d💲📢 Buat lo yang suka main judi online, pasti pengen dapet keuntungan maksimal, kan? Nah, di Paguyuban4d💲📢, lo bakal dapetin itu semua. Mulai dari game-game seru, live draw Sydney tercepat, sampe bonus-bonus menggiurkan yang bakal bikin lo makin semangat. Cara Deposit, Withdraw, dan Bonus di Paguyuban4d💲📢 Pengen tau gimana cara deposit, withdraw, dan dapetin bonus di Paguyuban4d💲📢? Gampang banget, bro! Pertama, lo tinggal daftar jadi member, lalu deposit dana ke akun lo. Kalo udah, lo bisa main sepuasnya dan kalo menang, tinggal withdraw aja duitnya. Plus, lo bakal dapet bonus new member yang bikin senyum sampe ke telinga! Pola Bermain yang Bikin Nagih Di Paguyuban4d💲📢, pola bermainnya emang bikin nagih, bro! Tiap putaran memberikan sensasi yang berbeda, jadi lo pasti betah main di sini. Ditambah lagi dengan live draw Sydney tercepat yang bikin lo makin excited. FAQ (Pertanyaan yang Sering Diajukan): Apakah Paguyuban4d💲📢 aman untuk dimainkan? Tentu aja! Mereka udah punya reputasi bagus dan sistem keamanan yang canggih. Bagaimana cara mendaftar menjadi member? Caranya simpel, bro! Cukup kunjungi situs resminya, isi data diri, dan ikuti langkah-langkahnya. Apa saja permainan yang tersedia di Paguyuban4d💲📢? Mereka punya berbagai macam permainan, termasuk live draw Sydney tercepat. Ditambah lagi dengan bonus-bonus yang menggiurkan. Bagaimana cara mendapatkan bonus new member? Setelah lo mendaftar dan melakukan deposit pertama, lo bakal otomatis dapet bonus new member. Seru kan? Kesimpulan Jadi, kalo lo lagi nyari sensasi bermain judi online yang seru dan menguntungkan, Paguyuban4d💲📢 ini jawabannya, bro! Dengan live draw Sydney tercepat dan berbagai keuntungan lainnya, lo bakal betah main di sini. Yuk, buruan gabung dan raih kemenanganmu!
  • Topics

×
×
  • Create New...

Important Information

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