Minecraft Blogs / Article

[Modding] Block Generation Problem

  • 137 views, 1 today
  • 1
  • 0
AzulineKnight's Avatar AzulineKnight
Level 1 : New Explorer
0
AzulineKnight here, and I have one problem in an upcoming mod. I am creating a classic "new ore, new tools, new everything!" mod, but for some reason my block generation code that should generate the ore in the world doesn't work. The code doesn't come up as errors, and the only possible reason is because I don't know if I need a new type of code due to MCP and MC updates. I'll put both of my tries at world generation, and hopefully one of you modders from the community can help me out. Here's the code:

public void GenerateSurface(World world, Random rand, int baseX, int baseZ)
{
for(int x = 0; x < 30; x++)
{
int Xcoord = baseX + rand.nextInt(16);
int Zcoord = baseZ + rand.nextInt(16);
int Ycoord = world.getHeightValue(Xcoord, Zcoord);
(new WorldGenMinable(azuniteOre.blockID, 30)).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}

Here's my other, older code:

public void GenerateSurface(World world, Random rand, int baseX, int baseZ)
{
for(int x = 0; x < 30; x++)
{
int Xcoord = baseX + rand.nextInt(16);
int Ycoord = rand.nextInt(5);
int Zcoord = baseZ + rand.nextInt(16);
(new WorldGenMinable(azuniteOre.blockID, 30)).generate(world, rand, Xcoord, Ycoord, Zcoord);
}
}

If anyone can help me, remember to comment and tell me how. I REALLY need to find why it's not working.
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome