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

Public Member Functions

 Pumpkin (BlockFace direction)
 
 Pumpkin (final int type)
 
 Pumpkin (final Material type)
 
 Pumpkin (final int type, final byte data)
 
 Pumpkin (final Material type, final byte data)
 
boolean isLit ()
 
void setFacingDirection (BlockFace face)
 
BlockFace getFacing ()
 
String toString ()
 
Pumpkin 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 pumpkin.

Definition at line 9 of file Pumpkin.java.

Constructor & Destructor Documentation

org.bukkit.material.Pumpkin.Pumpkin ( BlockFace  direction)

Instantiate a pumpkin facing in a particular direction.

Parameters
directionthe direction the pumkin's face is facing

Definition at line 20 of file Pumpkin.java.

References org.bukkit.material.Pumpkin.setFacingDirection().

20  {
21  this();
22  setFacingDirection(direction);
23  }
void setFacingDirection(BlockFace face)
Definition: Pumpkin.java:60
org.bukkit.material.Pumpkin.Pumpkin ( final int  type)
Deprecated:
Magic value

Definition at line 30 of file Pumpkin.java.

30  {
31  super(type);
32  }
org.bukkit.material.Pumpkin.Pumpkin ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 43 of file Pumpkin.java.

43  {
44  super(type, data);
45  }
org.bukkit.material.Pumpkin.Pumpkin ( final Material  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 52 of file Pumpkin.java.

52  {
53  super(type, data);
54  }

Member Function Documentation

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

Gets the direction this block is facing

Returns
the direction this block is facing

Implements org.bukkit.material.Directional.

Definition at line 84 of file Pumpkin.java.

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

84  {
85  byte data = getData();
86 
87  switch (data) {
88  case 0x0:
89  return BlockFace.NORTH;
90 
91  case 0x1:
92  return BlockFace.EAST;
93 
94  case 0x2:
95  return BlockFace.SOUTH;
96 
97  case 0x3:
98  default:
99  return BlockFace.EAST;
100  }
101  }
void org.bukkit.material.Pumpkin.setFacingDirection ( BlockFace  face)

Sets the direction that this block is facing in

Parameters
faceThe facing direction

Implements org.bukkit.material.Directional.

Definition at line 60 of file Pumpkin.java.

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

Referenced by org.bukkit.material.Pumpkin.Pumpkin().

60  {
61  byte data;
62 
63  switch (face) {
64  case NORTH:
65  data = 0x0;
66  break;
67 
68  case EAST:
69  data = 0x1;
70  break;
71 
72  case SOUTH:
73  data = 0x2;
74  break;
75 
76  case WEST:
77  default:
78  data = 0x3;
79  }
80 
81  setData(data);
82  }

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