Search in sources :

Example 1 with CustomLevelheadCommand

use of cc.hyperium.mods.levelhead.command.CustomLevelheadCommand 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;
}
Also used : Sk1erMod(cc.hyperium.mods.sk1ercommon.Sk1erMod) AboveHeadRenderer(cc.hyperium.mods.levelhead.renderer.AboveHeadRenderer) MojangAuth(cc.hyperium.mods.levelhead.auth.MojangAuth) CustomLevelheadCommand(cc.hyperium.mods.levelhead.command.CustomLevelheadCommand) LevelheadCommand(cc.hyperium.mods.levelhead.command.LevelheadCommand) DisplayManager(cc.hyperium.mods.levelhead.display.DisplayManager) LevelheadChatRenderer(cc.hyperium.mods.levelhead.renderer.LevelheadChatRenderer) LevelheadJsonHolder(cc.hyperium.mods.levelhead.util.LevelheadJsonHolder) File(java.io.File) CustomLevelheadCommand(cc.hyperium.mods.levelhead.command.CustomLevelheadCommand)

Example 2 with CustomLevelheadCommand

use of cc.hyperium.mods.levelhead.command.CustomLevelheadCommand in project Hyperium by HyperiumClient.

the class Hyperium method registerCommands.

/**
 * Register Hyperium commands
 */
private void registerCommands() {
    HyperiumCommandHandler hyperiumCommandHandler = handlers.getHyperiumCommandHandler();
    hyperiumCommandHandler.registerCommand(new CommandBossbarGui());
    hyperiumCommandHandler.registerCommand(new CommandClearChat());
    hyperiumCommandHandler.registerCommand(new CommandConfigGui());
    hyperiumCommandHandler.registerCommand(new CommandCoords());
    hyperiumCommandHandler.registerCommand(new CommandDebug());
    hyperiumCommandHandler.registerCommand(new CommandDisableCommand());
    hyperiumCommandHandler.registerCommand(new CommandGarbageCollect());
    hyperiumCommandHandler.registerCommand(new CommandGuild());
    hyperiumCommandHandler.registerCommand(new CommandKeybinds());
    hyperiumCommandHandler.registerCommand(new CommandLogs());
    hyperiumCommandHandler.registerCommand(new CommandMessage());
    hyperiumCommandHandler.registerCommand(new CommandNameHistory());
    hyperiumCommandHandler.registerCommand(new CommandParticleAuras());
    hyperiumCommandHandler.registerCommand(new CommandParty());
    hyperiumCommandHandler.registerCommand(new CommandPing());
    hyperiumCommandHandler.registerCommand(new CommandStats());
    hyperiumCommandHandler.registerCommand(new CustomLevelheadCommand());
}
Also used : HyperiumCommandHandler(cc.hyperium.commands.HyperiumCommandHandler) CustomLevelheadCommand(cc.hyperium.mods.levelhead.command.CustomLevelheadCommand)

Aggregations

CustomLevelheadCommand (cc.hyperium.mods.levelhead.command.CustomLevelheadCommand)2 HyperiumCommandHandler (cc.hyperium.commands.HyperiumCommandHandler)1 MojangAuth (cc.hyperium.mods.levelhead.auth.MojangAuth)1 LevelheadCommand (cc.hyperium.mods.levelhead.command.LevelheadCommand)1 DisplayManager (cc.hyperium.mods.levelhead.display.DisplayManager)1 AboveHeadRenderer (cc.hyperium.mods.levelhead.renderer.AboveHeadRenderer)1 LevelheadChatRenderer (cc.hyperium.mods.levelhead.renderer.LevelheadChatRenderer)1 LevelheadJsonHolder (cc.hyperium.mods.levelhead.util.LevelheadJsonHolder)1 Sk1erMod (cc.hyperium.mods.sk1ercommon.Sk1erMod)1 File (java.io.File)1