mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Place/Breaking/Activation logic separated from BlockAPI
This commit is contained in:
parent
6156baab85
commit
d9c87161ba
37 changed files with 387 additions and 216 deletions
|
|
@ -31,9 +31,13 @@ class CoalOreBlock extends SolidBlock{
|
|||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
return array(
|
||||
array(263, 0, 1),
|
||||
);
|
||||
if($item->isPickaxe() >= 1){
|
||||
return array(
|
||||
array(263, 0, 1), //Coal
|
||||
);
|
||||
}else{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,4 +30,13 @@ class DiamondOreBlock extends SolidBlock{
|
|||
parent::__construct(DIAMOND_ORE, 0, "Diamond Ore");
|
||||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
if($item->isPickaxe() >= 3){
|
||||
return array(
|
||||
array(264, 0, 1),
|
||||
);
|
||||
}else{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,9 +31,13 @@ class LapisOreBlock extends SolidBlock{
|
|||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
return array(
|
||||
array(351, 4, 1),
|
||||
);
|
||||
if($item->isPickaxe() >= 2){
|
||||
return array(
|
||||
array(351, 4, mt_rand(4, 8)),
|
||||
);
|
||||
}else{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -29,5 +29,13 @@ class RedstoneOreBlock extends SolidBlock{
|
|||
public function __construct(){
|
||||
parent::__construct(REDSTONE_ORE, 0, "Redstone Ore");
|
||||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
if($item->isPickaxe() >= 2){
|
||||
return array(
|
||||
//array(331, 4, mt_rand(4, 5)),
|
||||
);
|
||||
}else{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue