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

Public Member Functions

 FlowerPot ()
 
 FlowerPot (final int type)
 
 FlowerPot (final Material type)
 
 FlowerPot (final int type, final byte data)
 
 FlowerPot (final Material type, final byte data)
 
MaterialData getContents ()
 
void setContents (MaterialData materialData)
 
String toString ()
 
FlowerPot 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 flower pot.

Definition at line 10 of file FlowerPot.java.

Constructor & Destructor Documentation

org.bukkit.material.FlowerPot.FlowerPot ( )

Default constructor for a flower pot.

Definition at line 15 of file FlowerPot.java.

15  {
16  super(Material.FLOWER_POT);
17  }
org.bukkit.material.FlowerPot.FlowerPot ( final int  type)
Deprecated:
Magic value

Definition at line 24 of file FlowerPot.java.

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

Definition at line 37 of file FlowerPot.java.

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

Definition at line 46 of file FlowerPot.java.

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

Member Function Documentation

MaterialData org.bukkit.material.FlowerPot.getContents ( )

Get the material in the flower pot

Returns
material MaterialData for the block currently in the flower pot or null if empty

Definition at line 56 of file FlowerPot.java.

References org.bukkit.TreeSpecies.BIRCH, org.bukkit.GrassSpecies.FERN_LIKE, org.bukkit.TreeSpecies.GENERIC, org.bukkit.material.MaterialData.getData(), org.bukkit.TreeSpecies.JUNGLE, org.bukkit.material.MaterialData.MaterialData(), and org.bukkit.TreeSpecies.REDWOOD.

56  {
57  switch (getData()) {
58  case 1:
59  return new MaterialData(Material.RED_ROSE);
60  case 2:
61  return new MaterialData(Material.YELLOW_FLOWER);
62  case 3:
63  return new Tree(TreeSpecies.GENERIC);
64  case 4:
65  return new Tree(TreeSpecies.REDWOOD);
66  case 5:
67  return new Tree(TreeSpecies.BIRCH);
68  case 6:
69  return new Tree(TreeSpecies.JUNGLE);
70  case 7:
71  return new MaterialData(Material.RED_MUSHROOM);
72  case 8:
73  return new MaterialData(Material.BROWN_MUSHROOM);
74  case 9:
75  return new MaterialData(Material.CACTUS);
76  case 10:
77  return new MaterialData(Material.DEAD_BUSH);
78  case 11:
79  return new LongGrass(GrassSpecies.FERN_LIKE);
80  default:
81  return null;
82  }
83  }
void org.bukkit.material.FlowerPot.setContents ( MaterialData  materialData)

Set the contents of the flower pot

Parameters
materialDataMaterialData of the block to put in the flower pot.

Definition at line 90 of file FlowerPot.java.

References org.bukkit.TreeSpecies.BIRCH, org.bukkit.GrassSpecies.FERN_LIKE, org.bukkit.TreeSpecies.GENERIC, org.bukkit.material.MaterialData.getItemType(), org.bukkit.TreeSpecies.REDWOOD, and org.bukkit.material.MaterialData.setData().

90  {
91  Material mat = materialData.getItemType();
92 
93  if (mat == Material.RED_ROSE) {
94  setData((byte) 1);
95  } else if (mat == Material.YELLOW_FLOWER) {
96  setData((byte) 2);
97  } else if (mat == Material.RED_MUSHROOM) {
98  setData((byte) 7);
99  } else if (mat == Material.BROWN_MUSHROOM) {
100  setData((byte) 8);
101  } else if (mat == Material.CACTUS) {
102  setData((byte) 9);
103  } else if (mat == Material.DEAD_BUSH) {
104  setData((byte) 10);
105  } else if (mat == Material.SAPLING) {
106  TreeSpecies species = ((Tree) materialData).getSpecies();
107 
108  if (species == TreeSpecies.GENERIC) {
109  setData((byte) 3);
110  } else if (species == TreeSpecies.REDWOOD) {
111  setData((byte) 4);
112  } else if (species == TreeSpecies.BIRCH) {
113  setData((byte) 5);
114  } else {
115  setData((byte) 6);
116  }
117  } else if (mat == Material.LONG_GRASS) {
118  GrassSpecies species = ((LongGrass) materialData).getSpecies();
119 
120  if (species == GrassSpecies.FERN_LIKE) {
121  setData((byte) 11);
122  }
123  }
124  }

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