forked from MirrorHub/authlib-injector
Add a simple workaround for MC-52974
This commit is contained in:
parent
4908893123
commit
980617e923
1 changed files with 14 additions and 0 deletions
|
@ -40,6 +40,9 @@ public class QueryProfileFilter implements URLFilter {
|
||||||
private YggdrasilClient mojangClient;
|
private YggdrasilClient mojangClient;
|
||||||
private YggdrasilClient customClient;
|
private YggdrasilClient customClient;
|
||||||
|
|
||||||
|
// see <https://github.com/yushijinhun/authlib-injector/issues/30>
|
||||||
|
private boolean mc52974WorkaroundEnabled;
|
||||||
|
|
||||||
public QueryProfileFilter(YggdrasilClient mojangClient, YggdrasilClient customClient) {
|
public QueryProfileFilter(YggdrasilClient mojangClient, YggdrasilClient customClient) {
|
||||||
this.mojangClient = mojangClient;
|
this.mojangClient = mojangClient;
|
||||||
this.customClient = customClient;
|
this.customClient = customClient;
|
||||||
|
@ -71,6 +74,10 @@ public class QueryProfileFilter implements URLFilter {
|
||||||
withSignature = true;
|
withSignature = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mc52974WorkaroundEnabled) {
|
||||||
|
withSignature = true;
|
||||||
|
}
|
||||||
|
|
||||||
Optional<GameProfile> response;
|
Optional<GameProfile> response;
|
||||||
if (QueryUUIDsFilter.isMaskedUUID(uuid)) {
|
if (QueryUUIDsFilter.isMaskedUUID(uuid)) {
|
||||||
response = mojangClient.queryProfile(QueryUUIDsFilter.unmaskUUID(uuid), withSignature);
|
response = mojangClient.queryProfile(QueryUUIDsFilter.unmaskUUID(uuid), withSignature);
|
||||||
|
@ -89,4 +96,11 @@ public class QueryProfileFilter implements URLFilter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMc52974WorkaroundEnabled() {
|
||||||
|
return mc52974WorkaroundEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMc52974WorkaroundEnabled(boolean mc52974WorkaroundEnabled) {
|
||||||
|
this.mc52974WorkaroundEnabled = mc52974WorkaroundEnabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue