mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
New extra.properties and ClientRenderFix
This commit is contained in:
parent
c3954dbdae
commit
a6aa36bbba
5 changed files with 175 additions and 10 deletions
|
|
@ -479,13 +479,15 @@ class PlayerAPI{
|
|||
);
|
||||
|
||||
if(!file_exists(DATA_PATH."players/".$iname.".yml")){
|
||||
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{
|
||||
$data = new Config(DATA_PATH."players/".$iname.".yml", CONFIG_YAML, $default);
|
||||
if($this->server->extraprops->get("save-player-data")) {
|
||||
console("[NOTICE] Player data not found for \"".$iname."\", creating new profile");
|
||||
$data = new Config(DATA_PATH."players/".$iname.".yml", CONFIG_YAML, $default);
|
||||
$data->save();
|
||||
}
|
||||
}
|
||||
|
||||
$data = new Config(DATA_PATH."players/".$iname.".yml", CONFIG_YAML, $default);
|
||||
|
||||
if(($data->get("gamemode") & 0x01) === 1){
|
||||
$data->set("health", 20);
|
||||
}
|
||||
|
|
@ -494,7 +496,9 @@ class PlayerAPI{
|
|||
}
|
||||
|
||||
public function saveOffline(Config $data){
|
||||
$this->server->handle("player.offline.save", $data);
|
||||
$data->save();
|
||||
if($this->server->extraprops->get("save-player-data")) {
|
||||
$this->server->handle("player.offline.save", $data);
|
||||
$data->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue