From 84cd841de2396ab6a25842d9c9a5c25610f7536b Mon Sep 17 00:00:00 2001 From: "Erymanthus[#5074] | (u/)RayDeeUx" <51521765+RayDeeUx@users.noreply.github.com> Date: Sat, 5 Nov 2022 10:33:09 -0400 Subject: Please use SkyGuide. Signed-off-by: Erymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com> --- .../skyblockhud/misc/PleaseUseSkyguide.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/com/thatgravyboat/skyblockhud/misc/PleaseUseSkyguide.java diff --git a/src/main/java/com/thatgravyboat/skyblockhud/misc/PleaseUseSkyguide.java b/src/main/java/com/thatgravyboat/skyblockhud/misc/PleaseUseSkyguide.java new file mode 100644 index 0000000..683c534 --- /dev/null +++ b/src/main/java/com/thatgravyboat/skyblockhud/misc/PleaseUseSkyguide.java @@ -0,0 +1,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; + } +} -- cgit