geforkt von Mirrors/Paper
Let TripwireHook be attachable. Addresses BUKKIT-2278
This commit also makes TripwireHook consistent with other attachables for the facing property. By: Wesley Wolfe <weswolf@aol.com>
Dieser Commit ist enthalten in:
Ursprung
4dc1654ae8
Commit
a0438b2a20
@ -6,7 +6,7 @@ import org.bukkit.block.BlockFace;
|
||||
/**
|
||||
* Represents the tripwire hook
|
||||
*/
|
||||
public class TripwireHook extends MaterialData implements Directional, Redstone {
|
||||
public class TripwireHook extends SimpleAttachableMaterialData implements Redstone {
|
||||
|
||||
public TripwireHook() {
|
||||
super(Material.TRIPWIRE_HOOK);
|
||||
@ -68,33 +68,32 @@ public class TripwireHook extends MaterialData implements Directional, Redstone
|
||||
public void setFacingDirection(BlockFace face) {
|
||||
int dat = getData() & 0xC;
|
||||
switch (face) {
|
||||
case EAST:
|
||||
break;
|
||||
case SOUTH:
|
||||
dat |= 0x1;
|
||||
break;
|
||||
case WEST:
|
||||
dat |= 0x2;
|
||||
break;
|
||||
case NORTH:
|
||||
dat |= 0x3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case NORTH:
|
||||
dat |= 0x1;
|
||||
break;
|
||||
case EAST:
|
||||
dat |= 0x2;
|
||||
break;
|
||||
case SOUTH:
|
||||
dat |= 0x3;
|
||||
break;
|
||||
case WEST:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
setData((byte) dat);
|
||||
}
|
||||
|
||||
public BlockFace getFacing() {
|
||||
public BlockFace getAttachedFace() {
|
||||
switch (getData() & 0x3) {
|
||||
case 0:
|
||||
return BlockFace.EAST;
|
||||
case 1:
|
||||
return BlockFace.SOUTH;
|
||||
case 2:
|
||||
return BlockFace.WEST;
|
||||
case 3:
|
||||
return BlockFace.NORTH;
|
||||
case 0:
|
||||
return BlockFace.EAST;
|
||||
case 1:
|
||||
return BlockFace.SOUTH;
|
||||
case 2:
|
||||
return BlockFace.WEST;
|
||||
case 3:
|
||||
return BlockFace.NORTH;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren