Jump to content

[1.7.10] setBlock error


Jstylezzz

Recommended Posts

Hi everyone

 

I've searched quite long on the Internet, but I couldn't find anything on this issue I'm having.. I followed a tutorial to generate structures, and all goes well until the part where I placed the structure.java in Eclipse, and fixed all other errors.

 

The error I am getting is

The method setBlock(World, int, int, int, Block, int) in the type structure is not applicable for the arguments (World, int, int, int, int, int)

 

And the actual code that causes this is

this.setBlock(world, i + 0, j + 0, k + 0, 0, 0);

And this is just one of the, I don't know how many, same errors I am getting. Not sure if it's needed, but here is the beginning of the function

public boolean generate(World world, Random rand, int i, int j, int k) 
{
	//check that each corner is one of the valid spawn blocks
	if(!locationIsValidSpawn(world, i, j, k) || !locationIsValidSpawn(world, i + 39, j, k) || !locationIsValidSpawn(world, i + 39, j, k + 65) || !locationIsValidSpawn(world, i, j, k + 65))
	{
		return false;
	}

	k = k - 10;
	i = i - 10;

	this.setBlock(world, i + 0, j + 0, k + 0, 0, 0);
//etc..

 

The code in the 'structure.java', comes from a file exported from MCEdit (.schematic), and was converted to java code using MrPonyCaptain's converter.

 

All help is appreciated, thanks in advance!

Link to comment
Share on other sites

setBlock(World, int, int, int, Block, int)

and

(World, int, int, int, int, int)

you need to change fifth parameter to a block as setblock only accepts it as a block not an int

 

Yeah I figured that that was the problem, I wasn't sure how to fix it though. As I see it now, I would need to change the fith '0' to Block.air right?

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



×
×
  • Create New...

Important Information

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