bed position is saved in playerdata, bed destruction will teleport you to the world spawn

This commit is contained in:
GameHerobrine 2025-06-05 14:09:04 +03:00
parent 60c29e9dd1
commit 6ab777e5e9
4 changed files with 39 additions and 14 deletions

View file

@ -65,7 +65,7 @@ class BedBlock extends TransparentBlock{
for($zCheck = $minZ; $zCheck <= $maxZ; ++$zCheck){
$idCheck = $level->level->getBlockID($xCheck, $y - 1, $zCheck);
if(!StaticBlock::getIsTransparent($idCheck) && $level->level->getBlockID($xCheck, $y, $zCheck) == 0 && $level->level->getBlockID($xCheck, $y + 1, $zCheck) == 0){
return new Vector3($xCheck, $y, $zCheck);
return new Position($xCheck, $y, $zCheck, $level);
}
}
}