mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-27 21:59:52 +00:00
Merge pull request #2614 from mmlmml1/master
Fixed for Iron bars and stonecutter
This commit is contained in:
commit
cb2157ea80
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Item;
|
||||||
|
|
||||||
class IronBars extends Thin{
|
class IronBars extends Thin{
|
||||||
|
|
||||||
@ -33,5 +34,36 @@ class IronBars extends Thin{
|
|||||||
public function getName(){
|
public function getName(){
|
||||||
return "Iron Bars";
|
return "Iron Bars";
|
||||||
}
|
}
|
||||||
|
public function getHardness(){
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBreakTime(Item $item){
|
||||||
|
switch($item->isPickaxe()){
|
||||||
|
case 5:
|
||||||
|
return 0.95;
|
||||||
|
case 4:
|
||||||
|
return 1.25;
|
||||||
|
case 3:
|
||||||
|
return 1.9;
|
||||||
|
case 2:
|
||||||
|
return 0.65;
|
||||||
|
case 1:
|
||||||
|
return 3.75;
|
||||||
|
default:
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDrops(Item $item){
|
||||||
|
if($item->isPickaxe() >= 1){
|
||||||
|
return [
|
||||||
|
[Item::IRON_BARS, 0, 1],
|
||||||
|
];
|
||||||
|
}else{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
@ -50,8 +50,12 @@ class Stonecutter extends Solid{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
if($item->isPickaxe() >= 1){
|
||||||
[$this->id, 0, 1],
|
return [
|
||||||
];
|
[Item::STONECUTTER, 0, 1],
|
||||||
|
];
|
||||||
|
}else{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user