Class BlockDoor


public class BlockDoor extends BlockType
  • Constructor Details

    • BlockDoor

      public BlockDoor(org.bukkit.Material itemMaterial)
  • Method Details

    • canPlaceAt

      public boolean canPlaceAt(GlowPlayer player, GlowBlock block, org.bukkit.block.BlockFace against)
      Description copied from class: BlockType
      Check whether the block can be placed at the given location.
      Overrides:
      canPlaceAt in class BlockType
      Parameters:
      player - The player who placed the block.
      block - The location the block is being placed at.
      against - The face the block is being placed against.
      Returns:
      Whether the placement is valid.
    • onBlockChanged

      public void onBlockChanged(GlowBlock block, org.bukkit.Material oldType, byte oldData, org.bukkit.Material newType, byte newData)
      Description copied from class: BlockType
      Called when this block has just changed to some other type.

      This is called whenever GlowBlock.setTypeIdAndData(int, byte, boolean), GlowBlock.setType(org.bukkit.Material) or GlowBlock.setData(byte) is called with physics enabled, and might be called from plugins or other means of changing the block.

      Overrides:
      onBlockChanged in class BlockType
      Parameters:
      block - The block that was changed
      oldType - The old Material
      oldData - The old data
      newType - The new Material
      newData - The new data
    • placeBlock

      public void placeBlock(GlowPlayer player, GlowBlockState state, org.bukkit.block.BlockFace face, org.bukkit.inventory.ItemStack holding, org.bukkit.util.Vector clickedLoc)
      Description copied from class: BlockType
      Called when a block is placed to calculate what the block will become.
      Overrides:
      placeBlock in class BlockType
      Parameters:
      player - the player who placed the block
      state - the BlockState to edit
      face - the face off which the block is being placed
      holding - the ItemStack that was being held
      clickedLoc - where in the block the click occurred
    • blockInteract

      public boolean blockInteract(GlowPlayer player, GlowBlock block, org.bukkit.block.BlockFace face, org.bukkit.util.Vector clickedLoc)
      Opens and closes the door when right-clicked by the player.
      Overrides:
      blockInteract in class BlockType
      Parameters:
      player - the player interacting
      block - the block interacted with
      face - the clicked face
      clickedLoc - where in the block the click occurred
      Returns:
      Whether the interaction occurred.
    • onRedstoneUpdate

      public void onRedstoneUpdate(GlowBlock block)
      Overrides:
      onRedstoneUpdate in class BlockType