Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.material.TexturedMaterial Class Referenceabstract
Inheritance diagram for org.bukkit.material.TexturedMaterial:
org.bukkit.material.MaterialData org.bukkit.material.MonsterEggs org.bukkit.material.SmoothBrick org.bukkit.material.Step

Public Member Functions

 TexturedMaterial (Material m)
 
 TexturedMaterial (int type)
 
 TexturedMaterial (final int type, final byte data)
 
 TexturedMaterial (final Material type, final byte data)
 
abstract List< MaterialgetTextures ()
 
Material getMaterial ()
 
void setMaterial (Material material)
 
String toString ()
 
TexturedMaterial 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 ()
 

Protected Member Functions

int getTextureIndex ()
 
void setTextureIndex (int idx)
 

Detailed Description

Represents textured materials like steps and smooth bricks

Definition at line 10 of file TexturedMaterial.java.

Constructor & Destructor Documentation

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

Definition at line 21 of file TexturedMaterial.java.

21  {
22  super(type);
23  }
org.bukkit.material.TexturedMaterial.TexturedMaterial ( final int  type,
final byte  data 
)
Deprecated:
Magic value

Definition at line 30 of file TexturedMaterial.java.

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

Definition at line 39 of file TexturedMaterial.java.

39  {
40  super(type, data);
41  }

Member Function Documentation

Material org.bukkit.material.TexturedMaterial.getMaterial ( )

Gets the current Material this block is made of

Returns
Material of this block

Definition at line 56 of file TexturedMaterial.java.

References org.bukkit.material.TexturedMaterial.getTextureIndex(), and org.bukkit.material.TexturedMaterial.getTextures().

56  {
57  int n = getTextureIndex();
58  if (n > getTextures().size() - 1) {
59  n = 0;
60  }
61 
62  return getTextures().get(n);
63  }
abstract List< Material > getTextures()
int org.bukkit.material.TexturedMaterial.getTextureIndex ( )
protected

Get material index from data

Returns
index of data in textures list
Deprecated:
Magic value

Definition at line 86 of file TexturedMaterial.java.

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

Referenced by org.bukkit.material.TexturedMaterial.getMaterial().

86  {
87  return getData(); // Default to using all bits - override for other mappings
88  }
abstract List<Material> org.bukkit.material.TexturedMaterial.getTextures ( )
abstract

Retrieve a list of possible textures. The first element of the list will be used as a default.

Returns
a list of possible textures for this block

Referenced by org.bukkit.material.TexturedMaterial.getMaterial(), and org.bukkit.material.TexturedMaterial.setMaterial().

void org.bukkit.material.TexturedMaterial.setMaterial ( Material  material)

Sets the material this block is made of

Parameters
materialNew material of this block

Definition at line 71 of file TexturedMaterial.java.

References org.bukkit.material.TexturedMaterial.getTextures(), and org.bukkit.material.TexturedMaterial.setTextureIndex().

71  {
72  if (getTextures().contains(material)) {
73  setTextureIndex(getTextures().indexOf(material));
74  } else {
75  setTextureIndex(0x0);
76  }
77  }
abstract List< Material > getTextures()
void org.bukkit.material.TexturedMaterial.setTextureIndex ( int  idx)
protected

Set material index

Parameters
idx- index of data in textures list
Deprecated:
Magic value

Definition at line 97 of file TexturedMaterial.java.

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

Referenced by org.bukkit.material.TexturedMaterial.setMaterial().

97  {
98  setData((byte) idx); // Defult to using all bits - override for other mappings
99  }

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