Place/Breaking/Activation logic separated from BlockAPI

This commit is contained in:
Shoghi Cervantes Pueyo 2013-02-03 18:55:59 +01:00
parent 6156baab85
commit d9c87161ba
37 changed files with 387 additions and 216 deletions

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}