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

Public Member Functions

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

MaterialData for torches

Definition at line 9 of file Torch.java.

Constructor & Destructor Documentation

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

Definition at line 19 of file Torch.java.

19  {
20  super(type);
21  }
org.bukkit.material.Torch.Torch ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 32 of file Torch.java.

32  {
33  super(type, data);
34  }
org.bukkit.material.Torch.Torch ( final Material  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 41 of file Torch.java.

41  {
42  super(type, data);
43  }

Member Function Documentation

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

Gets the face that this block is attached on

Returns
BlockFace attached to

Implements org.bukkit.material.Attachable.

Definition at line 50 of file Torch.java.

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

50  {
51  byte data = getData();
52 
53  switch (data) {
54  case 0x1:
55  return BlockFace.WEST;
56 
57  case 0x2:
58  return BlockFace.EAST;
59 
60  case 0x3:
61  return BlockFace.NORTH;
62 
63  case 0x4:
64  return BlockFace.SOUTH;
65 
66  case 0x5:
67  default:
68  return BlockFace.DOWN;
69  }
70  }
void org.bukkit.material.Torch.setFacingDirection ( BlockFace  face)

Sets the direction that this block is facing in

Parameters
faceThe facing direction

Implements org.bukkit.material.Directional.

Definition at line 72 of file Torch.java.

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

72  {
73  byte data;
74 
75  switch (face) {
76  case EAST:
77  data = 0x1;
78  break;
79 
80  case WEST:
81  data = 0x2;
82  break;
83 
84  case SOUTH:
85  data = 0x3;
86  break;
87 
88  case NORTH:
89  data = 0x4;
90  break;
91 
92  case UP:
93  default:
94  data = 0x5;
95  }
96 
97  setData(data);
98  }

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