always get level spawn when respawning instead of using spawnposition

This commit is contained in:
GameHerobrine 2025-06-05 14:23:38 +03:00
parent d735564948
commit f7fb798c0f

View file

@ -2424,7 +2424,7 @@ class Player{
$this->craftingType = CraftingRecipes::TYPE_INVENTORY; $this->craftingType = CraftingRecipes::TYPE_INVENTORY;
$this->checkSpawnPosition(); $this->checkSpawnPosition();
$tpTarget = $this->spawnPosition; $tpTarget = $this->level->getSpawn();
if($this->bedPosition != null){ if($this->bedPosition != null){
[$levelname, $x, $y, $z] = $this->bedPosition; [$levelname, $x, $y, $z] = $this->bedPosition;
$level = $this->server->api->level->get($levelname); $level = $this->server->api->level->get($levelname);
@ -2432,7 +2432,6 @@ class Player{
remove_bed: remove_bed:
$this->sendChat("The bed is missing or cannot be accessed."); $this->sendChat("The bed is missing or cannot be accessed.");
$this->setBedPosition(null); $this->setBedPosition(null);
$this->setSpawn($this->level->getSpawn());
}else{ }else{
$spawnPoint = BedBlock::findStandUpPosition($level, $x, $y, $z); $spawnPoint = BedBlock::findStandUpPosition($level, $x, $y, $z);
if($spawnPoint == null) goto remove_bed; if($spawnPoint == null) goto remove_bed;