Java Code Examples for cn.nukkit.item.Item#isSilkTouch()

The following examples show how to use cn.nukkit.item.Item#isSilkTouch() . 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: BlockOreEmerald.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_IRON) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    new ItemEmerald()
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 2
Source File: BlockOreLapis.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_STONE) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    new ItemDye(4, new NukkitRandom().nextRange(4, 8))
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 3
Source File: BlockOreDiamond.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_IRON) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    new ItemDiamond()
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 4
Source File: BlockEnderChest.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    Item.get(Item.OBSIDIAN, 0, 8)
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 5
Source File: BlockSnow.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isShovel() && item.getTier() >= ItemTool.TIER_WOODEN) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    new ItemSnowball(0, 4)
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 6
Source File: BlockOreRedstone.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_IRON) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    new ItemRedstone(0, new NukkitRandom().nextRange(4, 5))
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 7
Source File: BlockOreCoal.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) {
        if (item.isSilkTouch()){
            return new Item[]{
                    this.toItem()
            };
        } else {
            return new Item[]{
                    new ItemCoal()
            };
        }
    } else {
        return new Item[0];
    }
}
 
Example 8
Source File: BlockBookshelf.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isSilkTouch()){
        return new Item[]{
                this.toItem()
        };
    } else {
        return new Item[]{
                new ItemBook(0, 3)
        };
    }
}
 
Example 9
Source File: BlockSeaLantern.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isSilkTouch()){
        return new Item[]{
            this.toItem()
        };
    } else {
        return new Item[]{
                new ItemPrismarineCrystals(0, ThreadLocalRandom.current().nextInt(2, 4))
        };
    }
}
 
Example 10
Source File: BlockGlowstone.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    if (item.isSilkTouch()){
        return new Item[]{
                this.toItem()
        };
    } else {
        return new Item[]{
                new ItemGlowstoneDust(0, new NukkitRandom().nextRange(2, 4))
        };
    }
}
 
Example 11
Source File: BlockIce.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onBreak(Item item) {
    if (!item.isSilkTouch()) 
        this.getLevel().setBlock(this, new BlockWater(), true);
    return true;
}
 
Example 12
Source File: BlockIce.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return item.isSilkTouch() ? new Item[]{this.toItem()} : new Item[0];
}
 
Example 13
Source File: BlockIcePacked.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return item.isSilkTouch() ? new Item[]{this.toItem()} : new Item[0];
}
 
Example 14
Source File: BlockGrassPath.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return new Item[]{
            item.isSilkTouch() ? this.toItem() : new ItemBlock(new BlockDirt())
    };
}
 
Example 15
Source File: BlockGlassPane.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return item.isSilkTouch() ? new Item[]{this.toItem()} : new Item[0];
}
 
Example 16
Source File: BlockPodzol.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return new Item[]{
            item.isSilkTouch() ? this.toItem() : Block.get(Block.DIRT).toItem()
    };
}
 
Example 17
Source File: BlockMycelium.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return new Item[]{
            item.isSilkTouch() ? this.toItem() : new ItemBlock(new BlockDirt())
    };
}
 
Example 18
Source File: BlockGlass.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return item.isSilkTouch() ? new Item[]{this.toItem()} : new Item[0];
}
 
Example 19
Source File: BlockGlassPaneStained.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return item.isSilkTouch() ? new Item[]{this.toItem()} : new Item[0];
}
 
Example 20
Source File: BlockGrass.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
public Item[] getDrops(Item item) {
    return new Item[]{
            item.isSilkTouch() ? this.toItem() : new ItemBlock(new BlockDirt())
    };
}