diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt index 63bc5f471..da7ec6d4e 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniTestCommand.kt @@ -15,6 +15,7 @@ import at.hannibal2.skyhanni.utils.NEUItems.getNpcPriceOrNull import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.renderString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems +import net.minecraft.client.Minecraft import net.minecraft.nbt.NBTTagCompound import net.minecraftforge.common.MinecraftForge import net.minecraftforge.event.entity.player.ItemTooltipEvent @@ -24,6 +25,7 @@ import java.io.File class SkyHanniTestCommand { companion object { + private val config get() = SkyHanniMod.feature.dev var displayLine = "" var displayList = emptyList<List<Any>>() @@ -198,7 +200,7 @@ class SkyHanniTestCommand { builder.append("\n") builder.append("player name: '${LorenzUtils.getPlayerName()}'\n") builder.append("player uuid: '${LorenzUtils.getPlayerUuid()}'\n") - builder.append("repoAutoUpdate: ${SkyHanniMod.feature.dev.repoAutoUpdate}\n") + builder.append("repoAutoUpdate: ${config.repoAutoUpdate}\n") builder.append("\n") builder.append("onHypixel: ${LorenzUtils.onHypixel}\n") @@ -232,16 +234,16 @@ class SkyHanniTestCommand { @SubscribeEvent fun onShowInternalName(event: ItemTooltipEvent) { - if (!SkyHanniMod.feature.dev.showInternalName) return + if (!config.showInternalName) return val itemStack = event.itemStack ?: return val internalName = itemStack.getInternalName() - if ((internalName == NEUInternalName.NONE) && !SkyHanniMod.feature.dev.showEmptyNames) return + if ((internalName == NEUInternalName.NONE) && !config.showEmptyNames) return event.toolTip.add("Internal Name: '${internalName.asString()}'") } @SubscribeEvent fun onSHowNpcPrice(event: ItemTooltipEvent) { - if (!SkyHanniMod.feature.dev.showNpcPrice) return + if (!config.showNpcPrice) return val itemStack = event.itemStack ?: return val internalName = itemStack.getInternalNameOrNull() ?: return @@ -250,6 +252,16 @@ class SkyHanniTestCommand { } @SubscribeEvent + fun onRenderLocation(event: GuiRenderEvent.GameOverlayRenderEvent) { + if (LorenzUtils.inSkyBlock && Minecraft.getMinecraft().gameSettings.showDebugInfo) { + config.debugLocationPos.renderString( + "Current Area: ${HypixelData.skyBlockArea}", + posLabel = "SkyBlock Area (Debug)" + ) + } + } + + @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { } @@ -257,12 +269,12 @@ class SkyHanniTestCommand { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { if (!LorenzUtils.inSkyBlock) return - if (!SkyHanniMod.feature.dev.debugEnabled) return + if (!config.debugEnabled) return if (displayLine.isNotEmpty()) { - SkyHanniMod.feature.dev.debugPos.renderString("test: $displayLine", posLabel = "Test") + config.debugPos.renderString("test: $displayLine", posLabel = "Test") } - SkyHanniMod.feature.dev.debugPos.renderStringsAndItems(displayList, posLabel = "Test Display") + config.debugPos.renderStringsAndItems(displayList, posLabel = "Test Display") } @SubscribeEvent |