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

Public Member Functions

 Dispenser (BlockFace direction)
 
 Dispenser (final int type)
 
 Dispenser (final Material type)
 
 Dispenser (final int type, final byte data)
 
 Dispenser (final Material type, final byte data)
 
void setFacingDirection (BlockFace face)
 
BlockFace getFacing ()
 
Dispenser clone ()
 
- Public Member Functions inherited from org.bukkit.material.FurnaceAndDispenser
 FurnaceAndDispenser (final int type)
 
 FurnaceAndDispenser (final Material type)
 
 FurnaceAndDispenser (final int type, final byte data)
 
 FurnaceAndDispenser (final Material type, final byte data)
 
FurnaceAndDispenser clone ()
 
- Public Member Functions inherited from org.bukkit.material.DirectionalContainer
 DirectionalContainer (final int type)
 
 DirectionalContainer (final Material type)
 
 DirectionalContainer (final int type, final byte data)
 
 DirectionalContainer (final Material type, final byte data)
 
void setFacingDirection (BlockFace face)
 
BlockFace getFacing ()
 
String toString ()
 
DirectionalContainer 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

Represents a dispenser.

Definition at line 9 of file material/Dispenser.java.

Constructor & Destructor Documentation

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

Definition at line 25 of file material/Dispenser.java.

25  {
26  super(type);
27  }
org.bukkit.material.Dispenser.Dispenser ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 38 of file material/Dispenser.java.

38  {
39  super(type, data);
40  }
org.bukkit.material.Dispenser.Dispenser ( final Material  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 47 of file material/Dispenser.java.

47  {
48  super(type, data);
49  }

Member Function Documentation

BlockFace org.bukkit.material.Dispenser.getFacing ( )

Gets the direction this block is facing

Returns
the direction this block is facing

Implements org.bukkit.material.Directional.

Definition at line 83 of file material/Dispenser.java.

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

83  {
84  int data = getData() & 0x7;
85 
86  switch (data) {
87  case 0x0:
88  return BlockFace.DOWN;
89 
90  case 0x1:
91  return BlockFace.UP;
92 
93  case 0x2:
94  return BlockFace.NORTH;
95 
96  case 0x3:
97  return BlockFace.SOUTH;
98 
99  case 0x4:
100  return BlockFace.WEST;
101 
102  case 0x5:
103  default:
104  return BlockFace.EAST;
105  }
106  }
void org.bukkit.material.Dispenser.setFacingDirection ( BlockFace  face)

Sets the direction that this block is facing in

Parameters
faceThe facing direction

Implements org.bukkit.material.Directional.

Definition at line 51 of file material/Dispenser.java.

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

51  {
52  byte data;
53 
54  switch (face) {
55  case DOWN:
56  data = 0x0;
57  break;
58 
59  case UP:
60  data = 0x1;
61  break;
62 
63  case NORTH:
64  data = 0x2;
65  break;
66 
67  case SOUTH:
68  data = 0x3;
69  break;
70 
71  case WEST:
72  data = 0x4;
73  break;
74 
75  case EAST:
76  default:
77  data = 0x5;
78  }
79 
80  setData(data);
81  }

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