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

Public Member Functions

 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 furnace or a dispenser.

Definition at line 9 of file DirectionalContainer.java.

Constructor & Destructor Documentation

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

Definition at line 15 of file DirectionalContainer.java.

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

Definition at line 28 of file DirectionalContainer.java.

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

Definition at line 37 of file DirectionalContainer.java.

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

Member Function Documentation

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

Gets the direction this block is facing

Returns
the direction this block is facing

Implements org.bukkit.material.Directional.

Definition at line 65 of file DirectionalContainer.java.

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

65  {
66  byte data = getData();
67 
68  switch (data) {
69  case 0x2:
70  return BlockFace.NORTH;
71 
72  case 0x3:
73  return BlockFace.SOUTH;
74 
75  case 0x4:
76  return BlockFace.WEST;
77 
78  case 0x5:
79  default:
80  return BlockFace.EAST;
81  }
82  }
void org.bukkit.material.DirectionalContainer.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 DirectionalContainer.java.

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

Referenced by org.bukkit.material.Chest.Chest(), org.bukkit.material.EnderChest.EnderChest(), and org.bukkit.material.Furnace.Furnace().

41  {
42  byte data;
43 
44  switch (face) {
45  case NORTH:
46  data = 0x2;
47  break;
48 
49  case SOUTH:
50  data = 0x3;
51  break;
52 
53  case WEST:
54  data = 0x4;
55  break;
56 
57  case EAST:
58  default:
59  data = 0x5;
60  }
61 
62  setData(data);
63  }

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