diff --git a/inc/page.php b/inc/page.php index 8adfa3a..28d1b2d 100644 --- a/inc/page.php +++ b/inc/page.php @@ -183,13 +183,16 @@ class Page { if ($name_under) { $name_under = $this->settings->avatar_names_below; } + $avatar_source = $this->settings->avatar_source; + if (strlen($uuid) === 36 && $uuid[14] === '3') { + $avatar_source = $this->settings->avatar_source_offline_mode; // Avatars cannot be associated with offline mode UUIDs (version 3) if (!$this->settings->avatar_allow_offline_mode_uuids) { $uuid = $name; } } - $src = str_replace('$NAME', $name, str_replace('$UUID', $uuid, $this->settings->avatar_source)); + $src = str_replace('$NAME', $name, str_replace('$UUID', $uuid, $avatar_source)); if (in_array($name, $this->settings->console_aliases) || $name === $this->settings->console_name) { $src = $this->settings->console_image; $name = $this->settings->console_name; diff --git a/inc/settings.php b/inc/settings.php index 9d0dcdc..e45ccfb 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -55,6 +55,7 @@ final class Settings { * 'https://minotar.net/avatar/$NAME/25' */ $this->avatar_source = 'https://crafatar.com/avatars/$UUID?size=25'; + $this->avatar_source_offline_mode = 'https://minotar.net/avatar/$NAME/25'; // If enabled, names will be shown below avatars instead of being shown next to them. $this->avatar_names_below = true;