Skip to content

Instantly share code, notes, and snippets.

Created January 18, 2014 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8487734 to your computer and use it in GitHub Desktop.
Save anonymous/8487734 to your computer and use it in GitHub Desktop.
public boolean transmuteBlock(int block1, int block2, World w, int x, int y, int z, int size) {
// if the blockID is the same as block1
if (w.getBlockId(x, y, z) == block1) {
// then change it to block2
w.setBlock(x, y, z, block2);
// else if the blockID is the same as block2
} else if (w.getBlockId(x, y, z) == block2) {
// then change it to block1
w.setBlock(x, y, z, block1);
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment