Check phase on sleep

This commit is contained in:
Shoghi Cervantes 2013-09-03 22:53:53 +02:00
parent 40a20d1467
commit f14999c57f

View File

@ -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;
}