mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fix save-player-data
This commit is contained in:
parent
274fd6456a
commit
747d87a3a7
2 changed files with 7 additions and 3 deletions
|
|
@ -392,12 +392,12 @@ class PlayerAPI{
|
|||
];
|
||||
|
||||
if(!file_exists(DATA_PATH . "players/" . $iname . ".yml")){
|
||||
if($this->server->extraprops->get("save-player-data") && $create){
|
||||
if(PocketMinecraftServer::$SAVE_PLAYER_DATA && $create){
|
||||
console("[NOTICE] Player data not found for \"" . $iname . "\", creating new profile");
|
||||
$data = new Config(DATA_PATH . "players/" . $iname . ".yml", CONFIG_YAML, $default);
|
||||
$data->save();
|
||||
}else{
|
||||
return false;
|
||||
return new Config(DATA_PATH . "players/$iname.yml", CONFIG_YAML, $default);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@ class PlayerAPI{
|
|||
}
|
||||
|
||||
public function saveOffline(Config $data){
|
||||
if($this->server->extraprops->get("save-player-data")){
|
||||
if(PocketMinecraftServer::$SAVE_PLAYER_DATA){
|
||||
$this->server->handle("player.offline.save", $data);
|
||||
$data->save();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue