mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
fixed #3702 and fix for setting timezone from php.ini
This commit is contained in:
parent
261ce1ba8b
commit
c1a484ee5c
@ -3375,9 +3375,16 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Vector3|Position|Location $pos
|
||||
* @param float $yaw
|
||||
* @param float $pitch
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function teleport(Vector3 $pos, $yaw = null, $pitch = null){
|
||||
if(!$this->isOnline()){
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
$oldPos = $this->getPosition();
|
||||
@ -3398,11 +3405,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->spawnToAll();
|
||||
}
|
||||
|
||||
|
||||
$this->resetFallDistance();
|
||||
$this->nextChunkOrderRun = 0;
|
||||
$this->newPosition = null;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,11 +164,13 @@ namespace pocketmine {
|
||||
* This is here so that people don't come to us complaining and fill up the issue tracker when they put
|
||||
* an incorrect timezone abbreviation in php.ini apparently.
|
||||
*/
|
||||
$default_timezone = date_default_timezone_get();
|
||||
if(strpos($default_timezone, "/") === false){
|
||||
$default_timezone = timezone_name_from_abbr($default_timezone);
|
||||
$timezone = ini_get("date.timezone");
|
||||
if(strpos($timezone, "/") === false){
|
||||
$default_timezone = timezone_name_from_abbr($timezone);
|
||||
ini_set("date.timezone", $default_timezone);
|
||||
date_default_timezone_set($default_timezone);
|
||||
} else {
|
||||
date_default_timezone_set($timezone);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user