mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 10:01:53 +00:00
Check phase on sleep
This commit is contained in:
parent
40a20d1467
commit
f14999c57f
@ -27,10 +27,13 @@ class BedBlock extends TransparentBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onActivate(Item $item, Player $player){
|
public function onActivate(Item $item, Player $player){
|
||||||
|
if(ServerAPI::request()->api->time->getPhase($player->level) !== "night"){
|
||||||
|
$player->dataPacket(MC_CLIENT_MESSAGE, array(
|
||||||
|
"message" => "You can only sleep at night."
|
||||||
|
));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$player->sleepOn($this);
|
$player->sleepOn($this);
|
||||||
/*$player->dataPacket(MC_CLIENT_MESSAGE, array(
|
|
||||||
"message" => "This bed has been corrupted by your hands!"
|
|
||||||
));*/
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user