Search in sources :

Example 1 with PriceInfoTooltip

use of me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip in project Skyblocker by LifeIsAParadox.

the class Utils method sbChecker.

public static void sbChecker() {
    MinecraftClient client = MinecraftClient.getInstance();
    List<String> sidebar;
    if (client.world == null || client.isInSingleplayer() || (sidebar = getSidebar()) == null) {
        isOnSkyblock = false;
        isInDungeons = false;
        return;
    }
    String string = sidebar.toString();
    if (sidebar.isEmpty())
        return;
    if (sidebar.get(0).contains("SKYBLOCK") && !isOnSkyblock) {
        if (!isInjected) {
            isInjected = true;
            ItemTooltipCallback.EVENT.register(PriceInfoTooltip::onInjectTooltip);
        }
        Events.onSkyblockJoin();
    }
    if (!sidebar.get(0).contains("SKYBLOCK") && isOnSkyblock)
        Events.onSkyblockDisconnect();
    isInDungeons = isOnSkyblock && string.contains("The Catacombs");
}
Also used : MinecraftClient(net.minecraft.client.MinecraftClient) PriceInfoTooltip(me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip)

Aggregations

PriceInfoTooltip (me.xmrvizzy.skyblocker.skyblock.item.PriceInfoTooltip)1 MinecraftClient (net.minecraft.client.MinecraftClient)1