use of me.semx11.autotip.api.reply.impl.LocaleReply in project Hyperium by HyperiumClient.
the class Autotip method reloadLocale.
public void reloadLocale() {
LocaleReply reply = LocaleRequest.of(this).execute();
if (!reply.isSuccess()) {
throw new IllegalStateException("Could not fetch locale");
}
localeHolder = reply.getLocaleHolder();
}
use of me.semx11.autotip.api.reply.impl.LocaleReply in project Hyperium by HyperiumClient.
the class LocaleRequest method execute.
@Override
public LocaleReply execute() {
HttpUriRequest request = GetBuilder.of(this).addParameter("lang", locale.toLanguageTag()).addParameter("v", version.get()).build();
Optional<Reply> optional = RequestHandler.getReply(this, request.getURI());
return optional.map(reply -> (LocaleReply) reply).orElseGet(() -> new LocaleReply(false));
}
Aggregations