Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 45 lines 1.1 kB view raw
1package org.bukkit.material; 2 3import org.bukkit.Material; 4import org.bukkit.block.BlockFace; 5 6/** 7 * Simple utility class for attachable MaterialData subclasses 8 */ 9public 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 20 public SimpleAttachableMaterialData(Material type, BlockFace direction) { 21 this(type); 22 setFacingDirection(direction); 23 } 24 25 public SimpleAttachableMaterialData(Material type) { 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 return getAttachedFace().getOppositeFace(); 39 } 40 41 @Override 42 public String toString() { 43 return super.toString() + " facing " + getFacing(); 44 } 45}