mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +00:00
stonecutter will drop only if destroyed with pick
This commit is contained in:
parent
da446ff7f7
commit
6d487fb4b0
4 changed files with 16 additions and 4 deletions
|
|
@ -23,7 +23,7 @@ class IronOreBlock extends SolidBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
if($item->getPickaxeLevel() >= 3){
|
if($item->getPickaxeLevel() >= ItemTool::STONE_LEVEL){
|
||||||
return array(
|
return array(
|
||||||
array(IRON_ORE, 0, 1),
|
array(IRON_ORE, 0, 1),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,13 @@ class StonecutterBlock extends SolidBlock{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item, Player $player){
|
public function getDrops(Item $item, Player $player){
|
||||||
return array(
|
if($item->getPickaxeLevel() >= ItemTool::WOODEN_LEVEL){
|
||||||
array($this->id, 0, 1),
|
return [
|
||||||
);
|
[$this->id, 0, 1],
|
||||||
|
];
|
||||||
|
}else{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
abstract class ItemPickaxe extends ItemTool
|
abstract class ItemPickaxe extends ItemTool
|
||||||
{
|
{
|
||||||
|
|
||||||
public function isTool(){
|
public function isTool(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
abstract class ItemTool extends Item
|
abstract class ItemTool extends Item
|
||||||
{
|
{
|
||||||
|
const WOODEN_LEVEL = 1;
|
||||||
|
const GOLD_LEVEL = 2;
|
||||||
|
const STONE_LEVEL = 3;
|
||||||
|
const IRON_LEVEL = 4;
|
||||||
|
const DIAMOND_LEVEL = 5;
|
||||||
|
|
||||||
public function isTool(){
|
public function isTool(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue