SHARE
TWEET

BlockWorks - Sending blocks

capasha Sep 8th, 2017 (edited) 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.   Example how to use this void
  3.     con.Send("b",Convert.ToUInt32(toBlocks(10,10,0)),Convert.ToUInt32(1));
  4.  
  5.   This will place gray block at position x 10 and y 10. Without channel data.
  6.  
  7.   With channel data. 12 is how many channels the block should have:
  8.     con.Send("b",Convert.ToUInt32(toBlocks(10,10,12)),Convert.ToUInt32(9));
  9. */
  10.  
  11. static int toBlocks(int x, int y, int c)
  12. {
  13.   return (c & 3) << 30 | (x & 32767) << 15 | y & 32767;
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top