Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.material.PistonExtensionMaterial Class Reference
Inheritance diagram for org.bukkit.material.PistonExtensionMaterial:
org.bukkit.material.MaterialData org.bukkit.material.Attachable org.bukkit.material.Directional

Public Member Functions

 PistonExtensionMaterial (final int type)
 
 PistonExtensionMaterial (final Material type)
 
 PistonExtensionMaterial (final int type, final byte data)
 
 PistonExtensionMaterial (final Material type, final byte data)
 
void setFacingDirection (BlockFace face)
 
BlockFace getFacing ()
 
boolean isSticky ()
 
void setSticky (boolean sticky)
 
BlockFace getAttachedFace ()
 
PistonExtensionMaterial clone ()
 
- Public Member Functions inherited from org.bukkit.material.MaterialData
 MaterialData (final int type)
 
 MaterialData (final Material type)
 
 MaterialData (final int type, final byte data)
 
 MaterialData (final Material type, final byte data)
 
byte getData ()
 
void setData (byte data)
 
Material getItemType ()
 
int getItemTypeId ()
 
ItemStack toItemStack ()
 
ItemStack toItemStack (int amount)
 
String toString ()
 
int hashCode ()
 
boolean equals (Object obj)
 
MaterialData clone ()
 

Detailed Description

Material data for the piston extension block

Definition at line 9 of file PistonExtensionMaterial.java.

Constructor & Destructor Documentation

org.bukkit.material.PistonExtensionMaterial.PistonExtensionMaterial ( final int  type)
Deprecated:
Magic value

Definition at line 15 of file PistonExtensionMaterial.java.

15  {
16  super(type);
17  }
org.bukkit.material.PistonExtensionMaterial.PistonExtensionMaterial ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 28 of file PistonExtensionMaterial.java.

28  {
29  super(type, data);
30  }
org.bukkit.material.PistonExtensionMaterial.PistonExtensionMaterial ( final Material  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 37 of file PistonExtensionMaterial.java.

37  {
38  super(type, data);
39  }

Member Function Documentation

BlockFace org.bukkit.material.PistonExtensionMaterial.getAttachedFace ( )

Gets the face that this block is attached on

Returns
BlockFace attached to

Implements org.bukkit.material.Attachable.

Definition at line 103 of file PistonExtensionMaterial.java.

References org.bukkit.material.PistonExtensionMaterial.getFacing().

103  {
104  return getFacing().getOppositeFace();
105  }
BlockFace org.bukkit.material.PistonExtensionMaterial.getFacing ( )

Gets the direction this block is facing

Returns
the direction this block is facing

Implements org.bukkit.material.Directional.

Definition at line 64 of file PistonExtensionMaterial.java.

References org.bukkit.material.MaterialData.getData().

Referenced by org.bukkit.material.PistonExtensionMaterial.getAttachedFace().

64  {
65  byte dir = (byte) (getData() & 7);
66 
67  switch (dir) {
68  case 0:
69  return BlockFace.DOWN;
70  case 1:
71  return BlockFace.UP;
72  case 2:
73  return BlockFace.NORTH;
74  case 3:
75  return BlockFace.SOUTH;
76  case 4:
77  return BlockFace.WEST;
78  case 5:
79  return BlockFace.EAST;
80  default:
81  return BlockFace.SELF;
82  }
83  }
boolean org.bukkit.material.PistonExtensionMaterial.isSticky ( )

Checks if this piston extension is sticky, and returns true if so

Returns
true if this piston is "sticky", or false

Definition at line 90 of file PistonExtensionMaterial.java.

References org.bukkit.material.MaterialData.getData().

90  {
91  return (getData() & 8) == 8;
92  }
void org.bukkit.material.PistonExtensionMaterial.setFacingDirection ( BlockFace  face)

Sets the direction that this block is facing in

Parameters
faceThe facing direction

Implements org.bukkit.material.Directional.

Definition at line 41 of file PistonExtensionMaterial.java.

References org.bukkit.material.MaterialData.getData(), and org.bukkit.material.MaterialData.setData().

41  {
42  byte data = (byte) (getData() & 0x8);
43 
44  switch (face) {
45  case UP:
46  data |= 1;
47  break;
48  case NORTH:
49  data |= 2;
50  break;
51  case SOUTH:
52  data |= 3;
53  break;
54  case WEST:
55  data |= 4;
56  break;
57  case EAST:
58  data |= 5;
59  break;
60  }
61  setData(data);
62  }
void org.bukkit.material.PistonExtensionMaterial.setSticky ( boolean  sticky)

Sets whether or not this extension is sticky

Parameters
stickytrue if sticky, otherwise false

Definition at line 99 of file PistonExtensionMaterial.java.

References org.bukkit.material.MaterialData.getData(), and org.bukkit.material.MaterialData.setData().

99  {
100  setData((byte) (sticky ? (getData() | 0x8) : (getData() & ~0x8)));
101  }

The documentation for this class was generated from the following file: