Jump to content

Recommended Posts

Posted

I have the following problem. I want to set all the blocks from the coordinates of a specific Integer[] to id 0.

 

I'm doing this with this code:

 

for (Integer[] coord : this.coords.get(meta))
{
System.out.println((x + coord[0]) + " " + (y + coord[1]) + " " + (z + coord[2]) + " " + world.getBlockId(x + coord[0], y + coord[1], z + coord[2]));
world.setBlock((x + coord[0]), (y + coord[1]), (z + coord[2]), 0);
}

 

Th output is now

 

2013-03-23 14:47:19 [iNFO] [sTDOUT] -274 64 94 2676
2013-03-23 14:47:19 [iNFO] [sTDOUT] -275 63 94 0
2013-03-23 14:47:19 [iNFO] [sTDOUT] -275 64 94 0

 

Which means that the final two are probably already 0. But this is not the case, they are 2676 too.

Here comes the weird thing. If I do this:

 

for (Integer[] coord : this.coords.get(meta))
{
System.out.println((x + coord[0]) + " " + (y + coord[1]) + " " + (z + coord[2]) + " " + world.getBlockId(x + coord[0], y + coord[1], z + coord[2]));
}

 

it prints out this:

 

2013-03-23 14:51:38 [iNFO] [sTDOUT] -277 65 114 2676
2013-03-23 14:51:38 [iNFO] [sTDOUT] -278 64 114 2676
2013-03-23 14:51:38 [iNFO] [sTDOUT] -278 65 114 2676

 

Which means that the id is indeed 2676. Now what have I done wrong? When I run the code, the blocks are still there, except the one that was called first.

mca.png

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.