Add setting for allowing non-English name in player list (#2556)

Non-vanilla server may have player name other than English, for example Chinese server can have player name in Chinese. This setting allow MCC to display those non-English name in the player list.
This commit is contained in:
ReinforceZwei 2023-08-02 14:00:11 +08:00 committed by GitHub
parent ac65482296
commit a8200b6e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2006 additions and 1273 deletions

View file

@ -2967,7 +2967,7 @@ namespace MinecraftClient
public void OnPlayerJoin(PlayerInfo player)
{
//Ignore placeholders eg 0000tab# from TabListPlus
if (!ChatBot.IsValidName(player.Name))
if (Config.Main.Advanced.IgnoreInvalidPlayerName && !ChatBot.IsValidName(player.Name))
return;
if (player.Name == username)

File diff suppressed because it is too large Load diff

View file

@ -843,4 +843,7 @@ If the connection to the Minecraft game server is blocked by the firewall, set E
<data name="ChatBot.WebSocketBot.DebugMode" xml:space="preserve">
<value>This setting is for developers who are developing a library that uses this chat bot to remotely execute procedures/commands/functions.</value>
</data>
<data name="Main.Advanced.ignore_invalid_playername" xml:space="preserve">
<value>Ignore invalid player name</value>
</data>
</root>

View file

@ -617,6 +617,9 @@ namespace MinecraftClient
[TomlInlineComment("$Main.Advanced.MinTerminalHeight$")]
public int MinTerminalHeight = 10;
[TomlInlineComment("$Main.Advanced.ignore_invalid_playername$")]
public bool IgnoreInvalidPlayerName = true;
/// <summary>
/// Load login/password using an account alias
/// </summary>

View file

@ -596,6 +596,16 @@ Coordinate = { x = 145, y = 64, y = 2045 }
**A movement speed higher than 2 may be considered cheating by some plugins.**
#### `IgnoreInvalidPlayerName`
- **Description:**
Minecraft player name can only consist of English letters, numbers, and underscore symbols. Other name will be considered as invalid and ignored by default.
- **Type:** `boolean`
- **Default:** `true`
</div>
### Account List section