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

The following examples show how to use cn.nukkit.item.ItemTool#TYPE_NONE . 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 Nukkit with GNU General Public License v3.0 6 votes vote down vote up
private static double toolBreakTimeBonus0(
        int toolType, int toolTier, boolean isWoolBlock, boolean isCobweb) {
    if (toolType == ItemTool.TYPE_SWORD) return isCobweb ? 15.0 : 1.0;
    if (toolType == ItemTool.TYPE_SHEARS) return isWoolBlock ? 5.0 : 15.0;
    if (toolType == ItemTool.TYPE_NONE) return 1.0;
    switch (toolTier) {
        case ItemTool.TIER_WOODEN:
            return 2.0;
        case ItemTool.TIER_STONE:
            return 4.0;
        case ItemTool.TIER_IRON:
            return 6.0;
        case ItemTool.TIER_DIAMOND:
            return 8.0;
        case ItemTool.TIER_GOLD:
            return 12.0;
        default:
            return 1.0;
    }
}
 
Example 2
Source File: Block.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
private static double toolBreakTimeBonus0(
        int toolType, int toolTier, boolean isWoolBlock, boolean isCobweb) {
    if (toolType == ItemTool.TYPE_SWORD) return isCobweb ? 15.0 : 1.0;
    if (toolType == ItemTool.TYPE_SHEARS) return isWoolBlock ? 5.0 : 15.0;
    if (toolType == ItemTool.TYPE_NONE) return 1.0;
    switch (toolTier) {
        case ItemTool.TIER_WOODEN:
            return 2.0;
        case ItemTool.TIER_STONE:
            return 4.0;
        case ItemTool.TIER_IRON:
            return 6.0;
        case ItemTool.TIER_DIAMOND:
            return 8.0;
        case ItemTool.TIER_GOLD:
            return 12.0;
        default:
            return 1.0;
    }
}
 
Example 3
Source File: Block.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
private static double toolBreakTimeBonus0(
        int toolType, int toolTier, boolean isWoolBlock, boolean isCobweb) {
    if(toolType == ItemTool.TYPE_SWORD) return isCobweb ? 15.0: 1.0;
    if(toolType == ItemTool.TYPE_SHEARS) return isWoolBlock ? 5.0: 15.0;
    if(toolType == ItemTool.TYPE_NONE) return 1.0;
    switch (toolTier) {
        case ItemTool.TIER_WOODEN: return 2.0;
        case ItemTool.TIER_STONE: return 4.0;
        case ItemTool.TIER_IRON: return 6.0;
        case ItemTool.TIER_DIAMOND: return 8.0;
        case ItemTool.TIER_GOLD: return 12.0;
        default: return 1.0;
    }
}
 
Example 4
Source File: Block.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
private static int toolType0(Item item) {
    if(item.isSword())      return ItemTool.TYPE_SWORD      ;
    if(item.isShovel())     return ItemTool.TYPE_SHOVEL     ;
    if(item.isPickaxe())    return ItemTool.TYPE_PICKAXE    ;
    if(item.isAxe())        return ItemTool.TYPE_AXE        ;
    if(item.isShears())     return ItemTool.TYPE_SHEARS     ;
    return ItemTool.TYPE_NONE;
}
 
Example 5
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 6
Source File: Block.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
private static int toolType0(Item item) {
    if (item.isSword()) return ItemTool.TYPE_SWORD;
    if (item.isShovel()) return ItemTool.TYPE_SHOVEL;
    if (item.isPickaxe()) return ItemTool.TYPE_PICKAXE;
    if (item.isAxe()) return ItemTool.TYPE_AXE;
    if (item.isShears()) return ItemTool.TYPE_SHEARS;
    return ItemTool.TYPE_NONE;
}
 
Example 7
Source File: Block.java    From Nukkit 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 8
Source File: Block.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
private static int toolType0(Item item) {
    if (item.isSword()) return ItemTool.TYPE_SWORD;
    if (item.isShovel()) return ItemTool.TYPE_SHOVEL;
    if (item.isPickaxe()) return ItemTool.TYPE_PICKAXE;
    if (item.isAxe()) return ItemTool.TYPE_AXE;
    if (item.isShears()) return ItemTool.TYPE_SHEARS;
    return ItemTool.TYPE_NONE;
}
 
Example 9
Source File: Block.java    From Nukkit 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 10
Source File: Block.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public int getToolType() {
    return ItemTool.TYPE_NONE;
}
 
Example 11
Source File: Block.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public int getToolType() {
    return ItemTool.TYPE_NONE;
}
 
Example 12
Source File: BlockChorusPlant.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_NONE;
}
 
Example 13
Source File: BlockChorusFlower.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getToolType() {
    return ItemTool.TYPE_NONE;
}
 
Example 14
Source File: Block.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public int getToolType() {
    return ItemTool.TYPE_NONE;
}