add authlibinjector.mojangAntiFeatures option

This commit is contained in:
Haowei Wen 2022-03-20 05:52:54 +08:00
parent 8fe84c802e
commit 565fc90dd7
4 changed files with 33 additions and 2 deletions

View file

@ -81,4 +81,17 @@ Configure Minecraft server with the following JVM parameter:
Do not show authentication server name in Minecraft menu screen.
By default, authlib-injector alters --versionType parameter to display the authentication server name.
This feature can be disabled using this option.
-Dauthlibinjector.mojangAntiFeatures={default|enabled|disabled}
Whether to turn on Minecraft's anti-features.
It's enabled by default if the authentication server does NOT send feature.enable_mojang_anti_features option.
These anti-features include:
- Minecraft server blocklist
- The API to query user privileges:
* Online chat (allowed if the option is disabled)
* Multiplayer (allowed if the option is disabled)
* Realms (allowed if the option is disabled)
* Telemetry (turned off if the option is disabled)
* Profanity filter (turned off if the option is disabled)
```

View file

@ -88,6 +88,19 @@ gradle
-Dauthlibinjector.noShowServerName
不要在 Minecraft 主界面展示验证服务器名称.
默认情况下, authlib-injector 通过更改 --versionType 参数来在 Minecraft 主界面显示验证服务器名称, 使用本选项可以禁用该功能.
-Dauthlibinjector.mojangAntiFeatures={default|enabled|disabled}
设置是否开启 Minecraft 的部分 anti-feature.
若验证服务器未设置 feature.enable_mojang_anti_features 选项, 则默认禁用.
Minecraft 的 anti-feature 包括:
- Minecraft 服务器屏蔽列表
- 查询用户权限的接口, 涵盖以下项目:
* 聊天权限 (禁用后默认允许)
* 多人游戏权限 (禁用后默认允许)
* 领域权限 (禁用后默认允许)
* 遥测 (禁用后默认关闭)
* 冒犯性内容过滤 (禁用后默认关闭)
```
## 捐助

View file

@ -243,7 +243,10 @@ public final class AuthlibInjector {
log(INFO, "Disabled Mojang namespace");
}
filters.add(new AntiFeaturesFilter());
boolean mojangAntiFeaturesDefault = Boolean.TRUE.equals(config.getMeta().get("feature.enable_mojang_anti_features"));
if (!Config.mojangAntiFeatures.isEnabled(mojangAntiFeaturesDefault)) {
filters.add(new AntiFeaturesFilter());
}
return filters;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Haowei Wen <yushijinhun@gmail.com> and contributors
* Copyright (C) 2022 Haowei Wen <yushijinhun@gmail.com> and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -59,6 +59,7 @@ public final class Config {
public static Set<String> ignoredPackages;
public static FeatureOption mojangNamespace;
public static FeatureOption legacySkinPolyfill;
public static FeatureOption mojangAntiFeatures;
public static boolean noShowServerName;
private static void initDebugOptions() {
@ -202,6 +203,7 @@ public final class Config {
mojangNamespace = parseFeatureOption("authlibinjector.mojangNamespace");
legacySkinPolyfill = parseFeatureOption("authlibinjector.legacySkinPolyfill");
mojangAntiFeatures = parseFeatureOption("authlibinjector.mojangAntiFeatures");
httpdDisabled = System.getProperty("authlibinjector.disableHttpd") != null;
noShowServerName = System.getProperty("authlibinjector.noShowServerName") != null;
}