Jump to content

[Solved]redoing world generation with custom ores


aw_wolfe

Recommended Posts

1.11.2

 

I lack in understanding how minecraft generates the world block information. I had been assuming that everything is generated on the fly when the system asks for a chunk of blocks and then minecraft data only stores things that the players have changed. So it 'overlays' the changes onto the procedural generation.--This may not be correct.

My issue is that I created some ores and set them to generate (using one of many examples) and they all did (or so I thought).  One ore was meant to be very rare, much rarer than diamonds. I am using this modding to teach my kids java, so for fun, I sent them looking for the rare or ('mithril'). They couldn't find it. So I created a custom command "/find [object] [radius]" that searches a given radius of blocks for a specific object(block).  Anyway, my rare ore wasn't generating at all. Testing it out, the minimum parameters I found actually generated any ore were (size=3, chances=1),so calling WorldGenMinable(ore, [size<3]) never produced any ore, ever.

 

genSurface(...){
	....
	generateOre(ModBlocks.oreMithril.getDefaultState(),world,random,chunkX*16,chunkZ*16,2,30,3,1);//min to spawn any
}

private void generateOre(IBlockState ore, World world, Random random, int x, int z, int minY, int maxY, int size, int chances) {
		int deltaY = maxY - minY;
	
		for (int i = 0; i < chances; i++) {
			BlockPos pos = new BlockPos(x + random.nextInt(16), minY + random.nextInt(deltaY), z + random.nextInt(16));
	
			WorldGenMinable generator = new WorldGenMinable(ore, size);
			generator.generate(world, random, pos);
		}
	}

I'm sure there is some reason in the WorldGenMinable code why...but, while doing all this, my kids were building their little world. After fixing the mithril ore, I tested in newly created world and it worked, generating at a rate of about 1/10 of diamond ore. Updating the mod in the game my kids were enjoying, and reloading the game. I once again checked with my /find command and the mithril was still not being generated. This I'm not sure why. my find searches over 8,000,000 blocks. I did not think that the blocks were created and stored at game creation, only a table or registered blocks and a procedural generation was done...if so, the new updated mod should have created some mithril.

 

Obviously, I don't know what is going on. If anyone can state how the minecraft world gen, data, overlay works, I'd appreciate it.  Also, if there is anything I can do to update a previous world with new worldgen (no new ores, just changing the chances of creating), I'd more than appreciate it (kids too).

 

Thanks,

Tony

Edited by aw_wolfe
solved
Link to comment
Share on other sites

35 minutes ago, aw_wolfe said:

So it 'overlays' the changes onto the procedural generation.--This may not be correct.

It is not.

When a chunk is generated fresh, it gets saved, regardless of if anything changed or not.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

4 hours ago, aw_wolfe said:

minecraft data only stores things that the players have changed.

 
 
 
 
 
 

Minecraft has no concept of what you've changed unless you explicitly code it to. When a chunk generates, it looks at what biome it is supposed to be, generates the height map (placing the biome-specific surface blocks as well), and then decorates it with ores, trees, structures, etc. Then that's it; it will not be generated/populated again. Once a chunk has been generated, it stays in that state forever (unless a mod regens the chunk manually, like Rejuvenation Missiles from ICBM). In your case, if a chunk generates before your ore is set to spawn, it will not spawn in that chunk. Any new world decorating you do (like fixing the spawn rate of your ore ) will only occur in freshly generated chunks.

 

Edit:

4 hours ago, aw_wolfe said:

8,000,000

 

 The fact that you were iterating over such a huge number of blocks also probably led you to think nothing was happening, when in fact it either crashed internally, was just taking a ridiculously long time, both, or something in between.

Edited by TheMasterGabriel
Link to comment
Share on other sites

Thanks.

 

I do get a return on /find command, even for the large searches...even if to say '0 found'. I figured the large search area would be well outside anything generated when my player is first created. I am testing against searching for diamonds and can search a radius of 300 in about 6 seconds.

 

I loaded new ore mod in a new world (generated with old ore mod and no mithril) and it did not find any. Then spend a few minutes flying off in one direction and re-searched,  and found some. So Draco is correct.  I did not expect minecraft to create that many chunks at start of game.

 

I think I'll write a custom command to turn some stone into mithril and use it once to 'patch' a world and then rely on the worldgen to take care of new areas.

Thanks.

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

    • OLO4D adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot gacor dengan transaksi mudah menggunakan Bank Bukopin. Berikut adalah beberapa alasan mengapa Anda harus memilih OLO4D: Slot Gacor Terbaik Kami menyajikan koleksi slot gacor terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Bukopin Kami menyediakan layanan transaksi mudah melalui Bank Bukopin untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Pasti Jackpot OLO4D memberikan jaminan bahwa setiap pemain pasti mendapatkan jackpot. Dengan peluang kemenangan yang tinggi, setiap putaran permainan bisa menjadi peluang untuk meraih keberuntungan besar.  
    • Balon168: Gampang Banjir Scatter Hitam Malam Ini Balon168 telah menjadi sorotan dalam dunia perjudian online, dan ada alasan kuat mengapa pemain semakin tertarik. Salah satu permainan unggulannya, yang dikenal dengan tingkat kemenangan yang tinggi, adalah varian "Gampang Banjir Scatter Hitam Malam Ini". Mari kita selami lebih dalam mengenai fenomena ini. Balon168: Destinasi Utama bagi Pecinta Slot     DAFTAR SEKARANG LINK VIP MAXWIN  
    • BALON168🎈: Situs Slot Gacor Terbaik, Termewah, dan Tergacor 2024 dengan RTP 99,99% Mudah Maxwin Jika Anda pencinta judi online, mencari situs yang dapat diandalkan dan memberikan pengalaman bermain yang memuaskan tentu menjadi prioritas. Salah satu opsi terbaik yang patut dipertimbangkan adalah BALON168🎈. Situs ini tidak hanya menawarkan berbagai permainan slot yang menarik, tetapi juga mempersembahkan keunggulan dan kenyamanan bagi para pemainnya. Keunggulan BALON168🎈 BALON168🎈 tidak hanya sekadar situs slot online biasa. Dengan reputasi yang solid dan terpercaya, BALON168🎈 telah menjadi destinasi favorit bagi para penggemar judi online di tahun 2024. Keunggulan yang ditawarkan mencakup: 1. RTP Tinggi 99,99% Salah satu hal yang membuat BALON168🎈 menonjol adalah tingkat pengembalian (RTP) yang luar biasa tinggi, mencapai 99,99%. Ini berarti pemain memiliki peluang besar untuk memenangkan hadiah besar setiap kali mereka memutar gulungan di slot BALON168🎈. 2. Permainan Slot Gacor BALON168🎈 dikenal sebagai situs slot gacor terbaik di tahun 2024. "Gacor" adalah istilah yang digunakan untuk mesin slot yang sering memberikan kemenangan kepada pemainnya. Dengan koleksi permainan slot yang beragam dan sering memberikan jackpot besar, BALON168🎈 memastikan pengalaman bermain yang memuaskan bagi para pengunjungnya. 3. Maxwin yang Mudah Di BALON168🎈, peluang maxwin tidak hanya menjadi impian belaka. Dengan fitur yang mudah dimengerti dan diakses, pemain memiliki kesempatan yang besar untuk meraih kemenangan maksimum dalam setiap permainan yang mereka mainkan. Keamanan dan Kepuasan Pemain BALON168🎈 mengutamakan keamanan dan kepuasan para pemainnya. Dengan sistem keamanan terkini dan perlindungan data yang canggih, para pemain dapat bermain dengan tenang tanpa khawatir tentang privasi dan keamanan mereka. Layanan pelanggan yang responsif dan ramah juga selalu siap membantu para pemain dalam setiap masalah atau pertanyaan yang mereka miliki.       ❱❱❱❱❱ DAFTAR DI SINI ❰❰❰❰❰ ❱❱❱❱❱ DAFTAR AKUN PRO ❰❰❰❰❰ ❱❱❱❱❱ DAFTAR AKUN VIP ❰❰❰❰❰            
    • LadangToto2 adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot gacor dengan transaksi mudah menggunakan Bank Mestika. Berikut adalah beberapa alasan mengapa Anda harus memilih LadangToto2: Slot Gacor Terbaik Kami menyajikan koleksi slot gacor terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank Mestika Kami menyediakan layanan transaksi mudah melalui Bank Mestika untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan. Hadiah Hingga 100 Juta LadangToto2 memberikan kesempatan untuk meraih hadiah hingga 100 juta dalam kemenangan. Dengan jackpot dan hadiah-hadiah besar yang ditawarkan, setiap putaran permainan bisa menjadi peluang untuk meraih keberuntungan besar.  
    • Mengapa Memilih LadangToto? LadangToto adalah pilihan terbaik bagi Anda yang mencari pengalaman bermain slot gacor WD Maxwin dengan transaksi mudah menggunakan Bank BNI. Berikut adalah beberapa alasan mengapa Anda harus memilih LadangToto: Slot Gacor WD Maxwin Terbaik Kami menyajikan koleksi slot gacor WD Maxwin terbaik yang menawarkan kesenangan bermain dan peluang kemenangan besar. Dengan fitur-fitur unggulan dan tema-tema menarik, setiap putaran permainan akan memberikan Anda pengalaman yang tak terlupakan. Transaksi Mudah dengan Bank BNI Kami menyediakan layanan transaksi mudah melalui Bank BNI untuk kenyamanan dan keamanan Anda. Dengan proses yang cepat dan efisien, Anda dapat melakukan deposit dan penarikan dana dengan lancar dan tanpa hambatan.  
  • Topics

×
×
  • Create New...

Important Information

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