Package net.glowstone.inventory

Examples of net.glowstone.inventory.MaterialMatcher.matches()


    public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
        LinkedList<ItemStack> drops = new LinkedList<>();

        MaterialMatcher neededTool = getNeededMiningTool(block);
        if (neededTool == null ||
                (tool != null && neededTool.matches(tool.getType()))) {
            drops.addAll(getBlockDrops(block));
        }

        for (ItemStack i : ((TEContainer) block.getTileEntity()).getInventory().getContents()) {
            if (i != null) {
View Full Code Here


public abstract class BlockNeedsTool extends BlockType {
    @Override
    public final Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
        MaterialMatcher neededTool = getNeededMiningTool(block);
        if (neededTool != null &&
                (tool == null || !neededTool.matches(tool.getType())))
            return BlockDropless.EMPTY_STACK;

        return getMinedDrops(block, tool);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.