Package org.bukkit.material

# Class Door

java.lang.Object
org.bukkit.material.MaterialData
org.bukkit.material.Door

All Implemented Interfaces:
  `Cloneable`, `Directional`, `Openable`

@Deprecated public class Door extends MaterialData implements Directional, Openable
Deprecated.
all usage of MaterialData is deprecated and subject to removal. Use `BlockData`.
Represents a door. This class was previously deprecated, but has been retrofitted to work with modern doors. Some methods are undefined dependant on `isTopHalf()` due to Minecraft's internal representation of doors.

See Also:
  - `Material.LEGACY_WOODEN_DOOR`
  - `Material.LEGACY_IRON_DOOR_BLOCK`
  - `Material.LEGACY_SPRUCE_DOOR`
  - `Material.LEGACY_BIRCH_DOOR`
  - `Material.LEGACY_JUNGLE_DOOR`
  - `Material.LEGACY_ACACIA_DOOR`
  - `Material.LEGACY_DARK_OAK_DOOR`

## Constructor Summary

Constructors
Constructor
Description
`Door()`
Deprecated.
Artifact of old API, equivalent to new `Door(Material.LEGACY_WOODEN_DOOR);`
`Door(Material type)`
Deprecated.
`Door(Material type, boolean isHingeRight)`
Deprecated.
Constructs the top half of door of the given material type and with the hinge on the left or right
`Door(Material type, byte data)`
Deprecated.
Magic value
`Door(Material type, BlockFace face)`
Deprecated.
Constructs the bottom half of a door of the given material type, facing the specified direction and set to closed
`Door(Material type, BlockFace face, boolean isOpen)`
Deprecated.
Constructs the bottom half of a door of the given material type, facing the specified direction and set to open or closed
`Door(TreeSpecies species, boolean isHingeRight)`
Deprecated.
Constructs the top half of a wooden door of the given species and with the hinge on the left or right
`Door(TreeSpecies species, BlockFace face)`
Deprecated.
Constructs the bottom half of a wooden door of the given species, facing the specified direction and set to closed
`Door(TreeSpecies species, BlockFace face, boolean isOpen)`
Deprecated.
Constructs the bottom half of a wooden door of the given species, facing the specified direction and set to open or closed

## Method Summary

Modifier and Type
Method
Description
`Door`
`clone()`
Deprecated.
`BlockFace`
`getFacing()`
Deprecated.
Get the direction that this door is facing.
`boolean`
`getHinge()`
Deprecated.
Returns the side of the door the hinge is on.
`BlockFace`
`getHingeCorner()`
Deprecated.
This method should not be used; use hinge and facing accessors instead.
`static Material`
`getWoodDoorOfSpecies(TreeSpecies species)`
Deprecated.
Returns the item type of a wooden door for the given tree species.
`boolean`
`isOpen()`
Deprecated.
Result is undefined if `isTopHalf()` is true.
`boolean`
`isTopHalf()`
Deprecated.
`void`
`setFacingDirection(BlockFace face)`
Deprecated.
Set the direction that this door should is facing.
`void`
`setHinge(boolean isHingeRight)`
Deprecated.
Set whether the hinge is on the left or right side.
`void`
`setOpen(boolean isOpen)`
Deprecated.
Set whether the door is open.
`void`
`setTopHalf(boolean isTopHalf)`
Deprecated.
Configure this part of the door to be either the top or the bottom half
`String`
`toString()`
Deprecated.

### Methods inherited from class org.bukkit.material.MaterialData

`equals, getData, getItemType, hashCode, setData, toItemStack, toItemStack`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### Door

@Deprecated public Door()
Deprecated.
Artifact of old API, equivalent to new `Door(Material.LEGACY_WOODEN_DOOR);`

### Door

public Door(Material type)
Deprecated.

### Door

public Door(Material type, BlockFace face)
Deprecated.
Constructs the bottom half of a door of the given material type, facing the specified direction and set to closed

Parameters:
  `type` - The type of material this door is made of. This must match the type of the block above.
  `face` - The direction the door is facing.
See Also:
  - `Material.LEGACY_WOODEN_DOOR`
  - `Material.LEGACY_IRON_DOOR_BLOCK`
  - `Material.LEGACY_SPRUCE_DOOR`
  - `Material.LEGACY_BIRCH_DOOR`
  - `Material.LEGACY_JUNGLE_DOOR`
  - `Material.LEGACY_ACACIA_DOOR`
  - `Material.LEGACY_DARK_OAK_DOOR`
  - `BlockFace.WEST`
  - `BlockFace.NORTH`
  - `BlockFace.EAST`
  - `BlockFace.SOUTH`

### Door

public Door(Material type, BlockFace face, boolean isOpen)
Deprecated.
Constructs the bottom half of a door of the given material type, facing the specified direction and set to open or closed

Parameters:
  `type` - The type of material this door is made of. This must match the type of the block above.
  `face` - The direction the door is facing.
  `isOpen` - Whether the door is currently opened.
See Also:
  - `Material.LEGACY_WOODEN_DOOR`
  - `Material.LEGACY_IRON_DOOR_BLOCK`
  - `Material.LEGACY_SPRUCE_DOOR`
  - `Material.LEGACY_BIRCH_DOOR`
  - `Material.LEGACY_JUNGLE_DOOR`
  - `Material.LEGACY_ACACIA_DOOR`
  - `Material.LEGACY_DARK_OAK_DOOR`
  - `BlockFace.WEST`
  - `BlockFace.NORTH`
  - `BlockFace.EAST`
  - `BlockFace.SOUTH`

### Door

public Door(Material type, boolean isHingeRight)
Deprecated.
Constructs the top half of door of the given material type and with the hinge on the left or right

Parameters:
  `type` - The type of material this door is made of. This must match the type of the block below.
  `isHingeRight` - True if the hinge is on the right hand side, false if the hinge is on the left hand side.
See Also:
  - `Material.LEGACY_WOODEN_DOOR`
  - `Material.LEGACY_IRON_DOOR_BLOCK`
  - `Material.LEGACY_SPRUCE_DOOR`
  - `Material.LEGACY_BIRCH_DOOR`
  - `Material.LEGACY_JUNGLE_DOOR`
  - `Material.LEGACY_ACACIA_DOOR`
  - `Material.LEGACY_DARK_OAK_DOOR`

### Door

public Door(TreeSpecies species, BlockFace face)
Deprecated.
Constructs the bottom half of a wooden door of the given species, facing the specified direction and set to closed

Parameters:
  `species` - The species this wooden door is made of. This must match the species of the block above.
  `face` - The direction the door is facing.
See Also:
  - `TreeSpecies`
  - `BlockFace.WEST`
  - `BlockFace.NORTH`
  - `BlockFace.EAST`
  - `BlockFace.SOUTH`

### Door

public Door(TreeSpecies species, BlockFace face, boolean isOpen)
Deprecated.
Constructs the bottom half of a wooden door of the given species, facing the specified direction and set to open or closed

Parameters:
  `species` - The species this wooden door is made of. This must match the species of the block above.
  `face` - The direction the door is facing.
  `isOpen` - Whether the door is currently opened.
See Also:
  - `TreeSpecies`
  - `BlockFace.WEST`
  - `BlockFace.NORTH`
  - `BlockFace.EAST`
  - `BlockFace.SOUTH`

### Door

public Door(TreeSpecies species, boolean isHingeRight)
Deprecated.
Constructs the top half of a wooden door of the given species and with the hinge on the left or right

Parameters:
  `species` - The species this wooden door is made of. This must match the species of the block below.
  `isHingeRight` - True if the hinge is on the right hand side, false if the hinge is on the left hand side.
See Also:
  - `TreeSpecies`

### Door

@Deprecated public Door(Material type, byte data)
Deprecated.
Magic value

Parameters:
  `type` - the type
  `data` - the raw data value

## Method Details

### getWoodDoorOfSpecies

public static Material getWoodDoorOfSpecies(TreeSpecies species)
Deprecated.
Returns the item type of a wooden door for the given tree species.

Parameters:
  `species` - The species of wood door required.
Returns:
  The item type for the given species.
See Also:
  - `Material.LEGACY_WOODEN_DOOR`
  - `Material.LEGACY_SPRUCE_DOOR`
  - `Material.LEGACY_BIRCH_DOOR`
  - `Material.LEGACY_JUNGLE_DOOR`
  - `Material.LEGACY_ACACIA_DOOR`
  - `Material.LEGACY_DARK_OAK_DOOR`

### isOpen

public boolean isOpen()
Deprecated.
Result is undefined if `isTopHalf()` is true.

Specified by:
  `isOpen` in interface `Openable`
Returns:
  true if the door has swung counterclockwise around its hinge.

### setOpen

public void setOpen(boolean isOpen)
Deprecated.
Set whether the door is open. Undefined if `isTopHalf()` is true.

Specified by:
  `setOpen` in interface `Openable`
Parameters:
  `isOpen` - True to open the door.

### isTopHalf

public boolean isTopHalf()
Deprecated.

Returns:
  whether this is the top half of the door

### setTopHalf

public void setTopHalf(boolean isTopHalf)
Deprecated.
Configure this part of the door to be either the top or the bottom half

Parameters:
  `isTopHalf` - True to make it the top half.

### getHingeCorner

@Deprecated public BlockFace getHingeCorner()
Deprecated.
This method should not be used; use hinge and facing accessors instead.

Returns:
  BlockFace.SELF

### toString

public String toString()
Deprecated.

Overrides:
  `toString` in class `MaterialData`

### setFacingDirection

public void setFacingDirection(BlockFace face)
Deprecated.
Set the direction that this door should is facing. Undefined if `isTopHalf()` is true.

Specified by:
  `setFacingDirection` in interface `Directional`
Parameters:
  `face` - the direction

### getFacing

public BlockFace getFacing()
Deprecated.
Get the direction that this door is facing. Undefined if `isTopHalf()` is true.

Specified by:
  `getFacing` in interface `Directional`
Returns:
  the direction

### getHinge

public boolean getHinge()
Deprecated.
Returns the side of the door the hinge is on. Undefined if `isTopHalf()` is false.

Returns:
  false for left hinge, true for right hinge

### setHinge

public void setHinge(boolean isHingeRight)
Deprecated.
Set whether the hinge is on the left or right side. Left is false, right is true. Undefined if `isTopHalf()` is false.

Parameters:
  `isHingeRight` - True if the hinge is on the right hand side, false if the hinge is on the left hand side.

### clone

public Door clone()
Deprecated.

Overrides:
  `clone` in class `MaterialData`