mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
Added Pumpkin & Lit Pumpkin rotation, closes
This commit is contained in:
parent
02ca227085
commit
8c939feed9
@ -32,7 +32,7 @@ class LitPumpkin extends Solid{
|
|||||||
|
|
||||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
if($player instanceof Player){
|
if($player instanceof Player){
|
||||||
$this->meta = (int) $player->getDirection();
|
$this->meta = ((int) $player->getDirection() + 5) % 4;
|
||||||
}
|
}
|
||||||
$this->getLevel()->setBlock($block, $this, true, true);
|
$this->getLevel()->setBlock($block, $this, true, true);
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\Player;
|
||||||
|
|
||||||
class Pumpkin extends Solid{
|
class Pumpkin extends Solid{
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
@ -28,4 +30,13 @@ class Pumpkin extends Solid{
|
|||||||
$this->hardness = 5;
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user