Skip to content

Instantly share code, notes, and snippets.

@tehbeard
Created April 23, 2012 14:51
Show Gist options
  • Save tehbeard/2471410 to your computer and use it in GitHub Desktop.
Save tehbeard/2471410 to your computer and use it in GitHub Desktop.
BlockState bs = signBlock.getState(); // get state of block
Sign s = (Sign)bs; // we know it's a sign already, cast the state to a signs State (org.bukkit.block.Sign)
s.setLine(0,"Hello World");//set first line
byte b = s.getRawData(); //get the byte of data this block holds (sign direction);
b += 1; // increment it (rotate sign slightly)
b = b & 0xf; //Keep lower 4 bits only (0-16)
s.setRawData(b);
s.update();//update block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment