mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +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){
|
||||
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->dataPacket(MC_CLIENT_MESSAGE, array(
|
||||
"message" => "This bed has been corrupted by your hands!"
|
||||
));*/
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user