Add a simple workaround for MC-52974

This commit is contained in:
yushijinhun 2019-01-05 20:52:50 +08:00
parent 4908893123
commit 980617e923
No known key found for this signature in database
GPG key ID: 5BC167F73EA558E4

View file

@ -40,6 +40,9 @@ public class QueryProfileFilter implements URLFilter {
private YggdrasilClient mojangClient;
private YggdrasilClient customClient;
// see <https://github.com/yushijinhun/authlib-injector/issues/30>
private boolean mc52974WorkaroundEnabled;
public QueryProfileFilter(YggdrasilClient mojangClient, YggdrasilClient customClient) {
this.mojangClient = mojangClient;
this.customClient = customClient;
@ -71,6 +74,10 @@ public class QueryProfileFilter implements URLFilter {
withSignature = true;
}
if (mc52974WorkaroundEnabled) {
withSignature = true;
}
Optional<GameProfile> response;
if (QueryUUIDsFilter.isMaskedUUID(uuid)) {
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;
}
}