mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Tool tier added to getDrops
This commit is contained in:
parent
958c3589c9
commit
94b79ac28a
@ -71,7 +71,7 @@ class Anvil extends Fallable{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[$this->id, 0, 1], //TODO break level
|
||||
];
|
||||
|
@ -49,7 +49,7 @@ class Bricks extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::BRICKS_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -135,7 +135,7 @@ class BurningFurnace extends Solid{
|
||||
|
||||
public function getDrops(Item $item){
|
||||
$drops = [];
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
$drops[] = [Item::FURNACE, 0, 1];
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ class Coal extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::COAL_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class CoalOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::COAL, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Cobblestone extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::COBBLESTONE, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Diamond extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::DIAMOND_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class DiamondOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::DIAMOND, 0, 1],
|
||||
];
|
||||
|
@ -55,7 +55,7 @@ class DoubleSlab extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::SLAB, $this->meta & 0x07, 2],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Emerald extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::EMERALD_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class EmeraldOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::EMERALD, 0, 1],
|
||||
];
|
||||
|
@ -97,7 +97,7 @@ class EnchantingTable extends Transparent{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[$this->id, 0, 1],
|
||||
];
|
||||
|
@ -60,7 +60,7 @@ class GlowingRedstoneOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::REDSTONE_DUST, 0, mt_rand(4, 5)],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Gold extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::GOLD_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class GoldOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 4){
|
||||
if($item->isPickaxe() >= Tool::TIER_IRON){
|
||||
return [
|
||||
[Item::GOLD_ORE, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Iron extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 3){
|
||||
if($item->isPickaxe() >= Tool::TIER_STONE){
|
||||
return [
|
||||
[Item::IRON_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class IronBars extends Thin{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::IRON_BARS, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class IronDoor extends Door{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::IRON_DOOR, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class IronOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 3){
|
||||
if($item->isPickaxe() >= Tool::TIER_STONE){
|
||||
return [
|
||||
[Item::IRON_ORE, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Lapis extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 3){
|
||||
if($item->isPickaxe() >= Tool::TIER_STONE){
|
||||
return [
|
||||
[Item::LAPIS_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class LapisOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 3){
|
||||
if($item->isPickaxe() >= Tool::TIER_STONE){
|
||||
return [
|
||||
[Item::DYE, 4, mt_rand(4, 8)],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class MossStone extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::MOSS_STONE, $this->meta, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class NetherBrick extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::NETHER_BRICKS, 0, 1],
|
||||
];
|
||||
|
@ -47,7 +47,6 @@ class NetherBrickFence extends Transparent {
|
||||
}
|
||||
|
||||
public function getToolType(){
|
||||
//Different then the woodfences
|
||||
return Tool::TYPE_PICKAXE;
|
||||
}
|
||||
|
||||
@ -61,9 +60,9 @@ class NetherBrickFence extends Transparent {
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= Tool::TYPE_WOODEN){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::NETHER_BRICK_FENCE, $this->meta, 1],
|
||||
[$this->id, $this->meta, 1],
|
||||
];
|
||||
}else{
|
||||
return [];
|
||||
|
@ -45,7 +45,7 @@ class Netherrack extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::NETHERRACK, 0, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Obsidian extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 5){
|
||||
if($item->isPickaxe() >= Tool::TIER_DIAMOND){
|
||||
return [
|
||||
[Item::OBSIDIAN, 0, 1],
|
||||
];
|
||||
|
@ -56,7 +56,7 @@ class Quartz extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::QUARTZ_BLOCK, $this->meta & 0x03, 1],
|
||||
];
|
||||
|
@ -45,7 +45,7 @@ class Redstone extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::REDSTONE_BLOCK, 0, 1],
|
||||
];
|
||||
|
@ -58,7 +58,7 @@ class RedstoneOre extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 2){
|
||||
if($item->isPickaxe() >= Tool::TIER_GOLD){
|
||||
return [
|
||||
[Item::REDSTONE_DUST, 0, mt_rand(4, 5)],
|
||||
];
|
||||
|
@ -55,7 +55,7 @@ class Sandstone extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::SANDSTONE, $this->meta & 0x03, 1],
|
||||
];
|
||||
|
@ -133,7 +133,7 @@ class Slab extends Transparent{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[$this->id, $this->meta & 0x07, 1],
|
||||
];
|
||||
|
@ -143,7 +143,7 @@ abstract class Stair extends Transparent{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[$this->getId(), 0, 1],
|
||||
];
|
||||
|
@ -37,7 +37,6 @@ class Stone extends Solid{
|
||||
|
||||
public function __construct($meta = 0){
|
||||
$this->meta = $meta;
|
||||
|
||||
}
|
||||
|
||||
public function getHardness(){
|
||||
|
@ -55,7 +55,7 @@ class StoneBricks extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::STONE_BRICKS, $this->meta & 0x03, 1],
|
||||
];
|
||||
|
@ -55,7 +55,7 @@ class Stonecutter extends Solid{
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= 1){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[Item::STONECUTTER, 0, 1],
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user