Cloneable, Directional, Openablepublic class Door extends MaterialData implements Directional, Openable
isTopHalf()
due to Minecraft's internal representation of doors.| Constructor | Description |
|---|---|
Door() |
Deprecated.
Artifact of old API, equivalent to new
Door(Material.LEGACY_WOODEN_DOOR); |
Door(Material type) |
|
Door(Material type,
boolean isHingeRight) |
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) |
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) |
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) |
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) |
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) |
Constructs the bottom half of a wooden door of the given species, facing the specified direction and set to open
or closed
|
| Modifier and Type | Method | Description |
|---|---|---|
Door |
clone() |
|
BlockFace |
getFacing() |
Get the direction that this door is facing.
|
boolean |
getHinge() |
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) |
Returns the item type of a wooden door for the given tree species.
|
boolean |
isOpen() |
Result is undefined if
isTopHalf() is true. |
boolean |
isTopHalf() |
|
void |
setFacingDirection(BlockFace face) |
Set the direction that this door should is facing.
|
void |
setHinge(boolean isHingeRight) |
Set whether the hinge is on the left or right side.
|
void |
setOpen(boolean isOpen) |
Set whether the door is open.
|
void |
setTopHalf(boolean isTopHalf) |
Configure this part of the door to be either the top or the bottom half
|
String |
toString() |
equals, getData, getItemType, hashCode, setData, toItemStack, toItemStack@Deprecated public Door()
Door(Material.LEGACY_WOODEN_DOOR);public Door(Material type)
public Door(Material type, BlockFace face)
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.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.SOUTHpublic Door(Material type, BlockFace face, boolean isOpen)
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.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.SOUTHpublic Door(Material type, boolean isHingeRight)
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.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_DOORpublic Door(TreeSpecies species, BlockFace face)
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.TreeSpecies,
BlockFace.WEST,
BlockFace.NORTH,
BlockFace.EAST,
BlockFace.SOUTHpublic Door(TreeSpecies species, BlockFace face, boolean isOpen)
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.TreeSpecies,
BlockFace.WEST,
BlockFace.NORTH,
BlockFace.EAST,
BlockFace.SOUTHpublic Door(TreeSpecies species, boolean isHingeRight)
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.TreeSpecies@Deprecated public Door(Material type, byte data)
type - the typedata - the raw data valuepublic static Material getWoodDoorOfSpecies(TreeSpecies species)
species - The species of wood door required.Material.LEGACY_WOODEN_DOOR,
Material.LEGACY_SPRUCE_DOOR,
Material.LEGACY_BIRCH_DOOR,
Material.LEGACY_JUNGLE_DOOR,
Material.LEGACY_ACACIA_DOOR,
Material.LEGACY_DARK_OAK_DOORpublic boolean isOpen()
isTopHalf() is true.public void setOpen(boolean isOpen)
isTopHalf() is true.public boolean isTopHalf()
public void setTopHalf(boolean isTopHalf)
isTopHalf - True to make it the top half.@Deprecated public BlockFace getHingeCorner()
public String toString()
toString in class MaterialDatapublic void setFacingDirection(BlockFace face)
isTopHalf() is true.setFacingDirection in interface Directionalface - the directionpublic BlockFace getFacing()
isTopHalf() is true.getFacing in interface Directionalpublic boolean getHinge()
isTopHalf() is false.public void setHinge(boolean isHingeRight)
isTopHalf() is false.isHingeRight - True if the hinge is on the right hand side, false if the hinge is on the left hand side.public Door clone()
clone in class MaterialDataCopyright © 2020. All rights reserved.