Jump to content

Custom Structure Generation


pmardle

Recommended Posts

Hi All,

 

As usual all the tutorials I have found for this issue are either out of date, or don't exist !!

 

I am trying to get a custom structure to spawn (similar to villages) - and am having the following issue.

 

	
public class WorldGenBarbarianVillage implements IWorldGenerator 
{
 public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
 {
 }
  private void generateSurface(World world, Random random, int blockX, int blockZ) 
  {
	  int Xcoord = blockX + random.nextInt(16);
	  int Ycoord = random.nextInt(60);
	  int Zcoord = blockZ + random.nextInt(16);
  
	  	   
 	(new WorldGenBarbarianVillage()).generate(world, random, Xcoord, Ycoord, Zcoord);
  }

}

}

 

This is in my Mod.java file, and the error is at the bit I underlines.

 

Error Message..

 

The method generate(Random, int, int, World, IChunkProvider, IChunkProvider) in the type ColoniesMain.WorldGenBarbarianVillage is not applicable for the arguments (World, Random, int, int, int)

 

I appreciate that it is probabaly caused by the variables not being the same in the two generate thingies (sorry not up on my terminology) - but I'll be damned if I can get this working..

 

Can anyone assist?? (I'm sure it's a noob mistake/Easy fix !!)

 

If you need it the code of my WorldGenBarbarianVillage is..

 

public class WorldGenBarbarianVillage extends WorldGenerator
{

public boolean generate(World var1, Random var2, int var3, int var4, int var5)
{
	while (var1.isAirBlock(var3, var4, var5)&& var4 > 2)
	{
		--var4;
	}

	var1.setBlock(var3, var4 + 1, var5, Block.blockDiamond.blockID);


	return true;
}}

 

Thanks in Advance !!

Link to comment
Share on other sites

Your two classes have the same name! You can't have multiple classes with the same name, so it is getting confused over which one the create when you say new WorldGenBarbarianVillage() ! That is the reason it is saying the arguments are incorrect, it thinks you are trying to use your IWorldGenertor not your WorldGenerator!

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



×
×
  • Create New...

Important Information

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