use of cc.hyperium.mods.levelhead.auth.MojangAuth in project Hyperium by HyperiumClient.
the class Levelhead method init.
@Override
public AbstractMod init() {
instance = this;
LevelheadJsonHolder jsonHolder = new LevelheadJsonHolder();
try {
jsonHolder = new LevelheadJsonHolder(FileUtils.readFileToString(new File(Hyperium.folder, "levelhead.json")));
} catch (Exception e) {
e.printStackTrace();
}
displayManager = new DisplayManager(jsonHolder, new File(Hyperium.folder, "levelhead.json"));
Multithreading.runAsync(() -> types = new LevelheadJsonHolder(rawWithAgent("https://api.sk1er.club/levelhead_config")));
Sk1erMod sk1erMod = new Sk1erMod("LEVEL_HEAD", VERSION, object -> {
count = object.optInt("count");
wait = object.optInt("wait", Integer.MAX_VALUE);
if (count == 0 || wait == Integer.MAX_VALUE) {
Hyperium.LOGGER.warn("An error occurred whilst loading loading internal Levelhead info.");
}
});
sk1erMod.checkStatus();
auth = new MojangAuth();
Multithreading.runAsync(() -> {
auth.auth();
if (auth.isFailed()) {
Hyperium.LOGGER.warn("Failed to authenticate with Levelhead: {}", auth.getFailedMessage());
}
});
userUuid = Minecraft.getMinecraft().getSession().getProfile().getId();
Hyperium.INSTANCE.getHandlers().getCommandHandler().registerCommand(new LevelheadCommand());
Hyperium.INSTANCE.getHandlers().getCommandHandler().registerCommand(new CustomLevelheadCommand());
LevelheadChatRenderer levelheadChatRenderer = new LevelheadChatRenderer(this);
EventBus.INSTANCE.register(this);
EventBus.INSTANCE.register(levelheadChatRenderer);
EventBus.INSTANCE.register(new AboveHeadRenderer(this));
Multithreading.runAsync(this::refreshPurchaseStates);
Multithreading.runAsync(this::refreshRawPurchases);
Multithreading.runAsync(this::refreshPaidData);
return this;
}
Aggregations