Package net.glowstone.block.blocktype
Class BlockDirectDrops
java.lang.Object
net.glowstone.block.itemtype.ItemType
net.glowstone.block.blocktype.BlockType
net.glowstone.block.blocktype.BlockNeedsTool
net.glowstone.block.blocktype.BlockDirectDrops
- Direct Known Subclasses:
BlockBeacon
,BlockEndRod
,BlockFence
,BlockGrassPath
,BlockIronTrapDoor
,BlockMagma
,BlockPumpkinBase
-
Nested Class Summary
Nested classes/interfaces inherited from class net.glowstone.block.itemtype.ItemType
ItemType.Context
-
Field Summary
Fields inherited from class net.glowstone.block.blocktype.BlockType
ADJACENT, drops, placeSound, SIDES, soundGroup
-
Constructor Summary
ConstructorDescriptionBlockDirectDrops
(MaterialMatcher neededTool) Creates a block type that drops nothing when broken.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.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.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.BlockDirectDrops
(org.bukkit.Material dropType, int data, int amount, MaterialMatcher neededTool) Creates a block type that drops an item directly when broken.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. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.bukkit.inventory.ItemStack
@NotNull Collection<org.bukkit.inventory.ItemStack>
getMinedDrops
(GlowBlock block) Get the items that would be dropped if the block was successfully mined.getNeededMiningTool
(GlowBlock block) Methods inherited from class net.glowstone.block.blocktype.BlockNeedsTool
getDrops
Methods inherited from class net.glowstone.block.blocktype.BlockType
afterDestroy, afterPlace, blockDestroy, blockInteract, canAbsorb, canOverride, canPlaceAt, canTickRandomly, createBlockEntity, getCastedBlockData, getOppositeBlockFace, getPlaceAs, getPlaceSound, getPulseTickSpeed, getSoundGroup, isPulseOnce, leftClickBlock, onBlockChanged, onEntityStep, onNearBlockChanged, onRedstoneUpdate, placeBlock, receivePulse, requestPulse, rightClickBlock, setDrops, setPlaceSound, updateBlock, updatePhysics, updatePhysicsAfterEvent, warnMaterialData
Methods inherited from class net.glowstone.block.itemtype.ItemType
getContext, getMaterial, getMaterials, getMaxStackSize, rightClickAir, setMaterial, setMaxStackSize, setPlaceAs, setPlaceAs, toString
-
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 nothingdata
- the damage or block-data value of the dropped itemamount
- the amount to dropneededTool
- the tool(s) that can break this block, or null if breakable without a tool
-
BlockDirectDrops
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 brokendata
- the damage or block-data value of the dropped itemamount
- the amount to drop
-
BlockDirectDrops
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 brokenneededTool
- 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 brokenamount
- 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
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 classBlockType
- Parameters:
block
- The block.- Returns:
- The drops from that block.
-
getNeededMiningTool
- Specified by:
getNeededMiningTool
in classBlockNeedsTool
-
getDrops
-