Java Code Examples for cn.nukkit.item.Item#getTier()
The following examples show how to use
cn.nukkit.item.Item#getTier() .
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: BlockOreDiamond.java From Jupiter with GNU General Public License v3.0 | 6 votes |
@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 2
Source File: BlockPrismarine.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 3
Source File: BlockFurnaceBurning.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ new ItemBlock(new BlockFurnace()) }; } else { return new Item[0]; } }
Example 4
Source File: BlockMossStone.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 5
Source File: BlockSlabRedSandstone.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 6
Source File: BlockBricks.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ Item.get(Item.BRICKS_BLOCK, 0, 1) }; } else { return new Item[0]; } }
Example 7
Source File: BlockQuartz.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 8
Source File: BlockEmerald.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 9
Source File: BlockIron.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_STONE) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 10
Source File: BlockPressurePlateStone.java From Jupiter with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 11
Source File: BlockBricks.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ Item.get(Item.BRICKS_BLOCK, 0, 1) }; } else { return new Item[0]; } }
Example 12
Source File: BlockDoubleSlabRedSandstone.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ Item.get(Item.RED_SANDSTONE_SLAB, this.getDamage() & 0x07, 2) }; } else { return new Item[0]; } }
Example 13
Source File: BlockGold.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_IRON) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 14
Source File: BlockCobblestone.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 15
Source File: BlockIronBars.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 16
Source File: BlockCoal.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 17
Source File: BlockStone.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ Item.get(this.getDamage() == 0 ? Item.COBBLESTONE : Item.STONE, this.getDamage(), 1) }; } else { return new Item[0]; } }
Example 18
Source File: BlockDoorIron.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_WOODEN) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 19
Source File: BlockGold.java From Nukkit with GNU General Public License v3.0 | 5 votes |
@Override public Item[] getDrops(Item item) { if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_IRON) { return new Item[]{ toItem() }; } else { return new Item[0]; } }
Example 20
Source File: Block.java From Nukkit with GNU General Public License v3.0 | 4 votes |
/** * @deprecated This function is lack of Player class and is not accurate enough, use #getBreakTime(Item, Player) * @param item item used * @return break time */ @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; }