Added Pumpkin & Lit Pumpkin rotation, closes

This commit is contained in:
Shoghi Cervantes 2014-09-10 12:36:05 +02:00
parent 02ca227085
commit 8c939feed9
2 changed files with 12 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class LitPumpkin extends Solid{
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($player instanceof Player){
$this->meta = (int) $player->getDirection();
$this->meta = ((int) $player->getDirection() + 5) % 4;
}
$this->getLevel()->setBlock($block, $this, true, true);

View File

@ -21,6 +21,8 @@
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\Player;
class Pumpkin extends Solid{
public function __construct(){
@ -28,4 +30,13 @@ class Pumpkin extends Solid{
$this->hardness = 5;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($player instanceof Player){
$this->meta = ((int) $player->getDirection() + 5) % 4;
}
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
}