Class BlockContainer

Direct Known Subclasses:
BlockBrewingStand, BlockChest, BlockDispenser, BlockFurnace, BlockHopper

public class BlockContainer extends BlockType
Base BlockType for containers.
  • Constructor Details

    • BlockContainer

      public BlockContainer()
  • Method Details

    • blockInteract

      public boolean blockInteract(GlowPlayer player, GlowBlock block, org.bukkit.block.BlockFace face, org.bukkit.util.Vector clickedLoc)
      Description copied from class: BlockType
      Called when a player attempts to interact with (right-click) a block of this type already in the world.
      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.
    • getDrops

      @NotNull public @NotNull Collection<org.bukkit.inventory.ItemStack> getDrops(GlowBlock block, org.bukkit.inventory.ItemStack tool)
      Description copied from class: BlockType
      Get the items that will be dropped by digging the block.
      Overrides:
      getDrops in class BlockType
      Parameters:
      block - The block being dug.
      tool - The tool used or null if fists or no tool was used.
      Returns:
      The drops that should be returned.
    • getMinedDrops

      @NotNull public @NotNull Collection<org.bukkit.inventory.ItemStack> getMinedDrops(GlowBlock block)
      Description copied from class: BlockType
      Get the items that would be dropped if the block was successfully mined. This is used f.e. to calculate TNT drops.
      Overrides:
      getMinedDrops in class BlockType
      Parameters:
      block - The block.
      Returns:
      The drops from that block.
    • getContentDrops

      public Collection<org.bukkit.inventory.ItemStack> getContentDrops(GlowBlock block)
      Returns the contents of a container.
      Parameters:
      block - a container block
      Returns:
      the container's contents as ItemStack instances
    • getBlockDrops

      protected Collection<org.bukkit.inventory.ItemStack> getBlockDrops(GlowBlock block)
      Returns the drops for block itself, WITHOUT it's contents.
      Parameters:
      block - The block the drops should be calculated for
      Returns:
      the drops
    • getNeededMiningTool

      protected MaterialMatcher getNeededMiningTool(GlowBlock block)