Java Code Examples for cn.nukkit.item.ItemTool#TYPE_SHOVEL

The following examples show how to use cn.nukkit.item.ItemTool#TYPE_SHOVEL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Block.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
private static boolean correctTool0(int blockToolType, Item item) {
    return (blockToolType == ItemTool.TYPE_SWORD    && item.isSword()   ) ||
            (blockToolType == ItemTool.TYPE_SHOVEL  && item.isShovel()  ) ||
            (blockToolType == ItemTool.TYPE_PICKAXE && item.isPickaxe() ) ||
            (blockToolType == ItemTool.TYPE_AXE     && item.isAxe()     ) ||
            (blockToolType == ItemTool.TYPE_SHEARS  && item.isShears()  ) ||
            blockToolType == ItemTool.TYPE_NONE;
}
 
Example 2
Source File: BlockConcretePowder.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 3
Source File: BlockClay.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 4
Source File: BlockGrassPath.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 5
Source File: BlockSoulSand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 6
Source File: BlockMycelium.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 7
Source File: BlockSand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 8
Source File: BlockFarmland.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 9
Source File: BlockClay.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 10
Source File: BlockSnowLayer.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 11
Source File: BlockSoulSand.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 12
Source File: BlockFarmland.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 13
Source File: BlockSnow.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 14
Source File: BlockGrassPath.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 15
Source File: Block.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @deprecated This function is lack of Player class and is not accurate enough, use #getBreakTime(Item, Player)
 */
@Deprecated
public double getBreakTime(Item item) {
    double base = this.getHardness() * 1.5;
    if (this.canBeBrokenWith(item)) {
        if (this.getToolType() == ItemTool.TYPE_SHEARS && item.isShears()) {
            base /= 15;
        } else if (
                (this.getToolType() == ItemTool.TYPE_PICKAXE && item.isPickaxe()) ||
                        (this.getToolType() == ItemTool.TYPE_AXE && item.isAxe()) ||
                        (this.getToolType() == ItemTool.TYPE_SHOVEL && item.isShovel())
                ) {
            int tier = item.getTier();
            switch (tier) {
                case ItemTool.TIER_WOODEN:
                    base /= 2;
                    break;
                case ItemTool.TIER_STONE:
                    base /= 4;
                    break;
                case ItemTool.TIER_IRON:
                    base /= 6;
                    break;
                case ItemTool.TIER_DIAMOND:
                    base /= 8;
                    break;
                case ItemTool.TIER_GOLD:
                    base /= 12;
                    break;
            }
        }
    } else {
        base *= 3.33;
    }

    if (item.isSword()) {
        base *= 0.5;
    }

    return base;
}
 
Example 16
Source File: BlockMycelium.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 17
Source File: Block.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
/**
 * @deprecated This function is lack of Player class and is not accurate enough, use #getBreakTime(Item, Player)
 */
@Deprecated
public double getBreakTime(Item item) {
    double base = this.getHardness() * 1.5;
    if (this.canBeBrokenWith(item)) {
        if (this.getToolType() == ItemTool.TYPE_SHEARS && item.isShears()) {
            base /= 15;
        } else if (
                (this.getToolType() == ItemTool.TYPE_PICKAXE && item.isPickaxe()) ||
                        (this.getToolType() == ItemTool.TYPE_AXE && item.isAxe()) ||
                        (this.getToolType() == ItemTool.TYPE_SHOVEL && item.isShovel())
                ) {
            int tier = item.getTier();
            switch (tier) {
                case ItemTool.TIER_WOODEN:
                    base /= 2;
                    break;
                case ItemTool.TIER_STONE:
                    base /= 4;
                    break;
                case ItemTool.TIER_IRON:
                    base /= 6;
                    break;
                case ItemTool.TIER_DIAMOND:
                    base /= 8;
                    break;
                case ItemTool.TIER_GOLD:
                    base /= 12;
                    break;
            }
        }
    } else {
        base *= 3.33;
    }

    if (item.isSword()) {
        base *= 0.5;
    }

    return base;
}
 
Example 18
Source File: BlockSnow.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 19
Source File: BlockConcretePowder.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}
 
Example 20
Source File: BlockSand.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_SHOVEL;
}