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

Public Member Functions

 Cake (int type)
 
 Cake (Material type)
 
 Cake (int type, byte data)
 
 Cake (Material type, byte data)
 
int getSlicesEaten ()
 
int getSlicesRemaining ()
 
void setSlicesEaten (int n)
 
void setSlicesRemaining (int n)
 
String toString ()
 
Cake 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

Definition at line 5 of file Cake.java.

Constructor & Destructor Documentation

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

Definition at line 15 of file Cake.java.

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

Definition at line 28 of file Cake.java.

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

Definition at line 37 of file Cake.java.

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

Member Function Documentation

int org.bukkit.material.Cake.getSlicesEaten ( )

Gets the number of slices eaten from this cake

Returns
The number of slices eaten

Definition at line 46 of file Cake.java.

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

46  {
47  return getData();
48  }
int org.bukkit.material.Cake.getSlicesRemaining ( )

Gets the number of slices remaining on this cake

Returns
The number of slices remaining

Definition at line 55 of file Cake.java.

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

55  {
56  return 6 - getData();
57  }
void org.bukkit.material.Cake.setSlicesEaten ( int  n)

Sets the number of slices eaten from this cake

Parameters
nThe number of slices eaten

Definition at line 64 of file Cake.java.

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

64  {
65  if (n < 6) {
66  setData((byte) n);
67  } // TODO: else destroy the block? Probably not possible though
68  }
void org.bukkit.material.Cake.setSlicesRemaining ( int  n)

Sets the number of slices remaining on this cake

Parameters
nThe number of slices remaining

Definition at line 75 of file Cake.java.

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

75  {
76  if (n > 6) {
77  n = 6;
78  }
79  setData((byte) (6 - n));
80  }

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