Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.1.43 #156

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 服务器屏蔽列表
- 查询用户权限的接口, 涵盖以下项目:
* 聊天权限 (禁用后默认允许)
* 多人游戏权限 (禁用后默认允许)
* 领域权限 (禁用后默认允许)
* 遥测 (禁用后默认关闭)
* 冒犯性内容过滤 (禁用后默认关闭)
```

## 捐助
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/moe/yushi/authlibinjector/AuthlibInjector.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ private static List<URLFilter> createFilters(APIMetadata config) {
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;
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/moe/yushi/authlibinjector/Config.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -59,6 +59,7 @@ public boolean isEnabled(boolean defaultValue) {
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() {
Expand Down Expand Up @@ -202,6 +203,7 @@ static void init() {

mojangNamespace = parseFeatureOption("authlibinjector.mojangNamespace");
legacySkinPolyfill = parseFeatureOption("authlibinjector.legacySkinPolyfill");
mojangAntiFeatures = parseFeatureOption("authlibinjector.mojangAntiFeatures");
httpdDisabled = System.getProperty("authlibinjector.disableHttpd") != null;
noShowServerName = System.getProperty("authlibinjector.noShowServerName") != null;
}
Expand Down