Class BlockDirectDrops

Direct Known Subclasses:
BlockBeacon, BlockEndRod, BlockFence, BlockGrassPath, BlockIronTrapDoor, BlockMagma, BlockPumpkinBase

public class BlockDirectDrops extends BlockNeedsTool
  • Constructor Details

    • BlockDirectDrops

      public BlockDirectDrops(org.bukkit.Material dropType, int data, int amount, MaterialMatcher neededTool)
      Creates a block type that drops an item directly when broken.
      Parameters:
      dropType - the type of item to drop when broken, or null to drop nothing
      data - the damage or block-data value of the dropped item
      amount - the amount to drop
      neededTool - the tool(s) that can break this block, or null if breakable without a tool
    • BlockDirectDrops

      public BlockDirectDrops(MaterialMatcher neededTool)
      Creates a block type that drops nothing when broken.
      Parameters:
      neededTool - the tool(s) that can break this block
    • BlockDirectDrops

      public BlockDirectDrops(org.bukkit.Material dropType, int data, int amount)
      Creates a block type that drops an item directly when broken, and can be broken without a tool.
      Parameters:
      dropType - the type of item to drop when broken
      data - the damage or block-data value of the dropped item
      amount - the amount to drop
    • BlockDirectDrops

      public BlockDirectDrops(org.bukkit.Material dropType, MaterialMatcher neededTool)
      Creates a block type that directly drops 1 copy of an item with damage or block data 0 when broken.
      Parameters:
      dropType - the type of item to drop when broken
      neededTool - the tool(s) that can break this block
    • BlockDirectDrops

      public BlockDirectDrops(org.bukkit.Material dropType, int amount)
      Creates a block type that directly drops an item with damage or block data 0 when broken, and can be broken without a tool.
      Parameters:
      dropType - the type of item to drop when broken
      amount - the amount to drop
    • BlockDirectDrops

      public BlockDirectDrops(org.bukkit.Material dropType)
      Creates a block type that directly drops 1 copy of an item with damage or block data 0 when broken, and can be broken without a tool.
      Parameters:
      dropType - the type of item to drop when broken
  • Method Details

    • 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.
    • getNeededMiningTool

      public MaterialMatcher getNeededMiningTool(GlowBlock block)
      Specified by:
      getNeededMiningTool in class BlockNeedsTool
    • getDrops

      protected org.bukkit.inventory.ItemStack getDrops(GlowBlock block)