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

This commit is contained in:
Tal Eisenberg 2011-01-21 16:30:18 -08:00 committed by Erik Broes
parent e44bb33109
commit c36a98db64
2 changed files with 2 additions and 4 deletions

View File

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

View File

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