Created
April 23, 2012 14:51
-
-
Save tehbeard/2471410 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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