Posted March 15, 201312 yr Seems like a bunch of block placement-related methods in World have gotten a fancy new parameter. I have a hard time with bitwise operators, would anybody mind explaining what this new parameter is used for? Edit: If you check my post below, I at least describe how to understand the bitwise AND operator, which appears with greater frequency in 1.5 code Edit 2: Regarding the setBlockAndMetadataWithUpdate method, the extra parameter supposedly specifies what, exactly, the "Update" part of the method does. See the post below by Turtle7878 for details.
March 16, 201312 yr After looking around a bit, I found that the Number "2" is placed behind the .setBlockAndMetadata as the last parm. Not sure what it does, however it works now.... >.> http://i715.photobucket.com/albums/ww155/JadeKnightblazer/AsgardShieldBannermain.png[/img]
March 20, 201312 yr Author Alright, I got off my lazy ass and figured out how all the bitwise AND expressions work, since they seem to have popped up all over the place in 1.5 code. Bitwise AND operations produce a value no greater than the second operand. You'll need a very basic understanding of reading binary numbers to understand this little lesson. A bitwise and produces a 1 if both bits of two compared numbers are one, and a zero under any other circumstances. Here's how it works: Let's try the expression (3 & 9) 1001 (9) 0011 (3) ______ 0001 (3 & 9) becomes the binary number 0001, because the far right digit is the only one in which both values have a 1. If you do the arithmetic, (x & 3) will always become either 0, 1, 2, or 3. 0 & 3 = 0 1 & 3 = 1 2 & 3 = 2 3 & 3 = 3 4 & 3 = 0 5 & 3 = 1 6 & 3 = 2 7 & 3 = 3 8 & 3 = 0 9 & 3 = 1 10 & 3 = 2 11 & 3 = 3 12 & 3 = 0 13 & 3 = 1 14 & 3 = 2 15 & 3 = 3 Obviously if you use (x & 4), or (x & 2), the resultant value will never exceed 4 or 2, respectively.
March 20, 201312 yr It's to do with what (system) gets updated/notified: 0 = no update 1 = neighbors only 2 = texture only 3 = both neighbors & texture
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.