package org.bukkit.material; import org.bukkit.Material; import org.bukkit.TreeSpecies; import org.bukkit.block.BlockFace; /** * Represents the different types of Tree block that face a direction. * * @see Material.LOG * @see Material.LOG_2 */ public class Tree extends Wood { protected static final Material DEFAULT_TYPE = Material.LOG; protected static final BlockFace DEFAULT_DIRECTION = BlockFace.UP; /** * Constructs a tree block. */ public Tree() { this(DEFAULT_TYPE, DEFAULT_SPECIES, DEFAULT_DIRECTION); } /** * Constructs a tree block of the given tree species. * * @param species the species of the tree block */ public Tree(TreeSpecies species) { this(DEFAULT_TYPE, species, DEFAULT_DIRECTION); } /** * Constructs a tree block of the given tree species, and facing the given * direction. * * @param species the species of the tree block * @param dir the direction the tree block is facing */ public Tree(TreeSpecies species, BlockFace dir) { this(DEFAULT_TYPE, species, dir); } /** * @param type the raw type id * @deprecated Magic value */ @Deprecated public Tree(final int type) { super(type); } /** * Constructs a tree block of the given type. * * @param type the type of tree block */ public Tree(final Material type) { this(type, DEFAULT_SPECIES, DEFAULT_DIRECTION); } /** * Constructs a tree block of the given type and tree species. * * @param type the type of tree block * @param species the species of the tree block */ public Tree(final Material type, TreeSpecies species) { this(type, species, DEFAULT_DIRECTION); } /** * Constructs a tree block of the given type and tree species, and facing * the given direction. * * @param type the type of tree block * @param species the species of the tree block * @param dir the direction the tree block is facing */ public Tree(final Material type, TreeSpecies species, BlockFace dir) { super(type, species); setDirection(dir); } /** * @param type the raw type id * @param data the raw data value * @deprecated Magic value */ @Deprecated public Tree(final int type, final byte data) { super(type, data); } /** * @param type the type * @param data the raw data value * @deprecated Magic value */ @Deprecated public Tree(final Material type, final byte data) { super(type, data); } /** * Get direction of the log * * @return one of: *