aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/misc/PleaseUseSkyguide.java
blob: 683c534262115e5261130fb91e1429ba066cffb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.thatgravyboat.skyblockhud.misc;

import net.minecraft.client.Minecraft;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;

import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;


/***********************
 * PleaseUseSkyguide
 * 
 * A Java class written by Erymanthus / RayDeeUx
 * and DeDiamondPro as a means to minimize instances
 * of enabling SBHud's minimap with SkyGuide installed.
 * 
 * God, would this shit even work?
***********************/

public class PleaseUseSkyguide {
    private boolean hasSentWarningForSession = false;

    @SubscribeEvent
    public void sendWarning(TickEvent.ClientTickEvent event){
        if (Minecraft.getMinecraft().thePlayer == null || !SkyblockHud.config.Map.showMiniMap || !Loader.isModLoaded("skyguide")) return;
        SkyblockHud.config.Map.showMiniMap = false;
        if (hasSentWarningForSession) return;
        Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[SBH] SkyGuide by DeDiamondPro has been detected. As a result, SBHud's minimap has been disabled. Please use SkyGuide instead."));
        //prevent sending warning more than once per session
        hasSentWarningForSession = true;
    }
}