Package org.bukkit.material
Class Tree
- java.lang.Object
-
- org.bukkit.material.MaterialData
-
- org.bukkit.material.Wood
-
- org.bukkit.material.Tree
-
- All Implemented Interfaces:
Cloneable
public class Tree extends Wood
Represents the different types of Tree block that face a direction.- See Also:
Material.LEGACY_LOG
,Material.LEGACY_LOG_2
-
-
Field Summary
Fields Modifier and Type Field Description protected static BlockFace
DEFAULT_DIRECTION
protected static Material
DEFAULT_TYPE
-
Fields inherited from class org.bukkit.material.Wood
DEFAULT_SPECIES
-
-
Constructor Summary
Constructors Constructor Description Tree()
Constructs a tree block.Tree(Material type)
Constructs a tree block of the given type.Tree(Material type, byte data)
Deprecated.Magic valueTree(Material type, TreeSpecies species)
Constructs a tree block of the given type and tree species.Tree(Material type, TreeSpecies species, BlockFace dir)
Constructs a tree block of the given type and tree species, and facing the given direction.Tree(TreeSpecies species)
Constructs a tree block of the given tree species.Tree(TreeSpecies species, BlockFace dir)
Constructs a tree block of the given tree species, and facing the given direction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tree
clone()
BlockFace
getDirection()
Get direction of the logvoid
setDirection(BlockFace dir)
Set direction of the logString
toString()
-
Methods inherited from class org.bukkit.material.Wood
getSpecies, setSpecies
-
Methods inherited from class org.bukkit.material.MaterialData
equals, getData, getItemType, hashCode, setData, toItemStack, toItemStack
-
-
-
-
Constructor Detail
-
Tree
public Tree()
Constructs a tree block.
-
Tree
public Tree(TreeSpecies species)
Constructs a tree block of the given tree species.- Parameters:
species
- the species of the tree block
-
Tree
public Tree(TreeSpecies species, BlockFace dir)
Constructs a tree block of the given tree species, and facing the given direction.- Parameters:
species
- the species of the tree blockdir
- the direction the tree block is facing
-
Tree
public Tree(Material type)
Constructs a tree block of the given type.- Parameters:
type
- the type of tree block
-
Tree
public Tree(Material type, TreeSpecies species)
Constructs a tree block of the given type and tree species.- Parameters:
type
- the type of tree blockspecies
- the species of the tree block
-
Tree
public Tree(Material type, TreeSpecies species, BlockFace dir)
Constructs a tree block of the given type and tree species, and facing the given direction.- Parameters:
type
- the type of tree blockspecies
- the species of the tree blockdir
- the direction the tree block is facing
-
Tree
@Deprecated public Tree(Material type, byte data)
Deprecated.Magic value- Parameters:
type
- the typedata
- the raw data value
-
-
Method Detail
-
getDirection
public BlockFace getDirection()
Get direction of the log- Returns:
- one of:
- BlockFace.TOP for upright (default)
- BlockFace.NORTH (east-west)
- BlockFace.WEST (north-south)
- BlockFace.SELF (directionless)
-
setDirection
public void setDirection(BlockFace dir)
Set direction of the log- Parameters:
dir
- - direction of end of log (BlockFace.SELF for no direction)
-
-