Search in sources :

Example 1 with MaterialMatcher

use of net.glowstone.inventory.MaterialMatcher in project Glowstone by GlowstoneMC.

the class BlockContainer method getDrops.

@NotNull
@Override
public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
    Collection<ItemStack> drops = getContentDrops(block);
    MaterialMatcher neededTool = getNeededMiningTool(block);
    if (neededTool == null || !InventoryUtil.isEmpty(tool) && neededTool.matches(InventoryUtil.itemOrEmpty(tool).getType())) {
        drops.addAll(getBlockDrops(block));
    }
    return drops;
}
Also used : MaterialMatcher(net.glowstone.inventory.MaterialMatcher) ItemStack(org.bukkit.inventory.ItemStack) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

MaterialMatcher (net.glowstone.inventory.MaterialMatcher)1 ItemStack (org.bukkit.inventory.ItemStack)1 NotNull (org.jetbrains.annotations.NotNull)1