mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Check phase on sleep
This commit is contained in:
parent
40a20d1467
commit
f14999c57f
1 changed files with 6 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue