Fixed Button/Lever, using a logical AND instead of XOR to get 3 face bits

By: Tal Eisenberg <eisental@gmail.com>
This commit is contained in:
Bukkit/Spigot
2011-01-21 16:30:18 -08:00
parent 845e8fbc2e
commit 45d9101f82
2 changed files with 2 additions and 4 deletions

View File

@@ -1,4 +1,3 @@
package org.bukkit.material;
import org.bukkit.block.BlockFace;
@@ -40,7 +39,7 @@ public class Button extends MaterialData implements Redstone, Attachable {
* @return BlockFace attached to
*/
public BlockFace getAttachedFace() {
byte data = (byte) (getData() ^ 0x7);
byte data = (byte) (getData() & 0x7);
switch (data) {
case 0x1:

View File

@@ -1,4 +1,3 @@
package org.bukkit.material;
import org.bukkit.block.BlockFace;
@@ -40,7 +39,7 @@ public class Lever extends MaterialData implements Redstone, Attachable {
* @return BlockFace attached to
*/
public BlockFace getAttachedFace() {
byte data = (byte) (getData() ^ 0x7);
byte data = (byte) (getData() & 0x7);
switch (data) {
case 0x1: