mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
better bed spawnpoint position
This commit is contained in:
parent
f05b66d992
commit
edc487f1f3
2 changed files with 37 additions and 2 deletions
|
|
@ -147,7 +147,15 @@ class Player{
|
|||
if($this->entity instanceof Entity){
|
||||
$this->entity->updateMetadata();
|
||||
}
|
||||
$this->setSpawn($pos);
|
||||
|
||||
$spawnPoint = BedBlock::findStandUpPosition($this->level, $pos->x, $pos->y, $pos->z);
|
||||
console($spawnPoint);
|
||||
if($spawnPoint == null) $spawnPoint = $pos->add(0.5, 1, 0.5);
|
||||
else{
|
||||
$spawnPoint->x += 0.5;
|
||||
$spawnPoint->z += 0.5;
|
||||
}
|
||||
$this->setSpawn($spawnPoint);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue