Fixed multiple players being able to sleep in the same bed

This commit is contained in:
Dylan K. Taylor 2022-02-10 00:57:43 +00:00
parent 4f44a067b0
commit 7e903fde5b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -166,7 +166,7 @@ class Bed extends Transparent{
}
public function onNearbyBlockChange() : void{
if(($other = $this->getOtherHalf()) !== null && $other->occupied !== $this->occupied){
if(!$this->head && ($other = $this->getOtherHalf()) !== null && $other->occupied !== $this->occupied){
$this->occupied = $other->occupied;
$this->position->getWorld()->setBlock($this->position, $this);
}