Jump to content

WorldGen requirements


traxys

Recommended Posts

I want to add a particular WorldGen , a block in the nether surronded by blocks or lava , no air block arround.

 

So for generating in the nether I use the code found in the wiki :

 

BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);

 

if(b.biomeName.equals("Hell")){

    //Generate the block

}

 

But I don't know how to test what blocks are around , so I am asking if someone would help me in giving a method , a piece of code , or anything that could help me figuring it out.

 

Thanks to anyone looking tis post , and even a greater Thanks to anyone helping me !

Link to comment
Share on other sites

But I don't know how to test what blocks are around , so I am asking if someone would help me in giving a method , a piece of code , or anything that could help me figuring it out.

 

world.getBlock(x, y, z) ?

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

How can I degine x, y and z ?

 

Because the worldGen method takes those coordonates parameters : chunkX , chunkZ and chunkY

 

That I define in my setBlock as "chunkX*16 + random.nextInt(16), 50, chunkZ*16 + random.nextInt(16)"

 

but because there is a random , if I take it a second time , is taht random changed , or because it is the same exuction of the function the random has not changed ?

 

But thak you :) Cause I think I can manage something still :)

 

 

 

Link to comment
Share on other sites

HOLY CRAP YOU CAN USE VARIABLES TO SAVE THE RESULTS OF A CALL TO RANDOM.

 

Yes, I'm mocking you:

Modder Support

 

This is the support section for those modding with Forge. Help with modding goes in here, however, please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here.

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

public class InfernalBlockGenerator implements IWorldGenerator{

 

@Override

public void generate(Random random, int chunkX, int chunkZ, World world,

IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);

int X = chunkX*16 + random.nextInt(16);

int Y = random.nextInt(31);

int Z = chunkZ*16 + random.nextInt(16);

 

if(b.biomeName.equals("Hell") &&

world.blockExists(X+1, Y, Z+1) && world.blockExists(X, Y, Z-1) &&

world.blockExists(X, Y-1, Z) && world.blockExists(X, Y+1, Z) &&

world.blockExists(X-1, Y, Z) && world.blockExists(X+1, Y, Z)){

world.setBlock(X, Y, Z, IdList.INFERNAL_BLOCK_ID);

}

}

 

}

 

I did this code , but I don't think I can check it , because of the fact that the block is surounded by blocks , so does someone know if it works ?

Link to comment
Share on other sites

That was not the method call mentioned above, but anyways you should probably head back to your programming studies for a little while. Learning the fundamentals and then the basics is not only recommended, it's a requirement :)

 

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Sorry, it should be world.getBlockId(x,y,z)

 

But if you can't use your javadoc and Eclipse codehinting properly I'm not going to help you.

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

So for generating in the nether I use the code found in the wiki :

 

BiomeGenBase b = world.getBiomeGenForCoords(chunkX, chunkZ);

     

if(b.biomeName.equals("Hell")){

    //Generate the block

}

"Hell" is the biome.

I'd suggest to generate in the Nether (the dimension) with this check:

world.provider.dimensionId==-1

Because you don't know if someone uses the "Hell" biome in its world or not.

Of course, you can do both checks, if you also want to be biome-specific.

Link to comment
Share on other sites

"Hell" is the biome.

I'd suggest to generate in the Nether (the dimension) with this check:

world.provider.dimensionId==-1

Because you don't know if someone uses the "Hell" biome in its world or not.

Of course, you can do both checks, if you also want to be biome-specific.

 

Do consider mods like Mystcraft which can created extra dimensions using any biome (including Sky and Hell).  If you're doing something like Nether Ore generation, your ores should generate in these dimensions.  Especially as some users wish to create "Nether Analogs" for their Ages.

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

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

    • If you have nvidia graphics, don't touch your amd drivers, otherwise it might fix it but keep running on integrated graphics, which will result in terrible performance. For nvidia graphics, you need to tell windows and nvidia control panel that anything Minecraft related (the launcher, java, etc...) should prefer high performance graphics so that it actually uses your nvidia gpu
    • In the ever-evolving landscape of technology, the rise of cryptocurrencies and digital assets has introduced both unparalleled opportunities and unprecedented challenges. As these digital currencies become increasingly prevalent, so too does the risk of theft and loss. Yet, amidst the complexity and uncertainty, there exists a beacon of hope: ADRIAN LAMO HACKER. Technology has indeed become more sophisticated and enhanced, presenting new challenges in the realm of asset recovery. However, just as any other currency can be stolen or lost, crypto and digital assets are not beyond redemption. With the right expertise and guidance, recovery is possible and achievable. Contact ADRIAN LAMO HACKER via the website: https://adrianlamohackpro.online/ , a trusted, honest, and certified agency specializing in the retrieval of stolen or lost digital assets. In my own experience, I found myself in dire straits after falling victim to cybercriminals who absconded with a significant portion of my crypto holdings. It was a daunting situation, but I refused to succumb to despair. Upon engaging ADRIAN LAMO HACKER, their professionalism, and integrity immediately struck me, as an unwavering commitment to their clients. They deeply understand blockchain technology and utilize advanced methodologies to trace and recover lost or stolen funds. Their approach is meticulous, their expertise unparalleled, and their results speak for themselves. In a matter of days, ADRIAN LAMO HACKER successfully traced and recovered over 90% of my stolen funds, a feat I once believed to be unattainable. Their fees were fair and transparent, and communication throughout the process was nothing short of excellent. They kept me informed every step of the way, providing reassurance and guidance when I needed it most. For anyone who has fallen victim to crypto theft or loss, I wholeheartedly recommend ADRIAN LAMO HACKER. They are not just experts in their field; they are guardians of justice in the digital realm. With their assistance, you can reclaim what's rightfully yours and emerge stronger than ever before. So, if you find yourself grappling with the devastation of lost or stolen digital assets, don't despair. Reach out to ADRIAN LAMO HACKER via website: https://adrianlamohackpro.online/  / Telegram: @ADRIANLAMOHACKERTECH and let them guide you toward a brighter tomorrow.
  • Topics

×
×
  • Create New...

Important Information

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