fix clearing textures of player, close #31

This commit is contained in:
printempw 2016-08-25 21:42:09 +08:00
parent 889dfad9fa
commit e1525cfad4
2 changed files with 7 additions and 8 deletions

View File

@ -131,14 +131,7 @@ class PlayerController extends BaseController
public function clearTexture()
{
$this->player->model->preference = "default";
$this->player->model->tid_steve = "";
$this->player->model->tid_alex = "";
$this->player->model->tid_cape = "";
$this->player->model->last_modified = Utils::getTimeFormatted();
$this->player->model->save();
$this->player->clearTexture();
View::json('角色 '.$this->player->model->player_name.' 的材质已被成功重置', 0);
}

View File

@ -73,6 +73,12 @@ class Player
return $this->model->save();
}
public function clearTexture()
{
$this->setPreference('default');
$this->setTexture(['tid_steve' => 0, 'tid_alex' => 0, 'tid_cape' => 0]);
}
public function getBinaryTexture($type)
{
if ($this->getTexture($type) != "") {