Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
SimpleAttachableMaterialData.java
Go to the documentation of this file.
1 package org.bukkit.material;
2 
3 import org.bukkit.Material;
4 import org.bukkit.block.BlockFace;
5 
9 public abstract class SimpleAttachableMaterialData extends MaterialData implements Attachable {
10 
11  public SimpleAttachableMaterialData(int type) {
12  super(type);
13  }
14 
15  public SimpleAttachableMaterialData(int type, BlockFace direction) {
16  this(type);
17  setFacingDirection(direction);
18  }
19 
21  this(type);
22  setFacingDirection(direction);
23  }
24 
26  super(type);
27  }
28 
29  public SimpleAttachableMaterialData(int type, byte data) {
30  super(type, data);
31  }
32 
33  public SimpleAttachableMaterialData(Material type, byte data) {
34  super(type, data);
35  }
36 
37  public BlockFace getFacing() {
38  BlockFace attachedFace = getAttachedFace();
39  return attachedFace == null ? null : attachedFace.getOppositeFace();
40  }
41 
42  @Override
43  public String toString() {
44  return super.toString() + " facing " + getFacing();
45  }
46 
47  @Override
49  return (SimpleAttachableMaterialData) super.clone();
50  }
51 }