diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt index 87def5df3..886827e23 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PetCandyUsedDisplay.kt @@ -1,19 +1,28 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.drawSlotText +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getMaxPetLevel import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetCandyUsed +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class PetCandyUsedDisplay { + private val config get() = SkyHanniMod.feature.misc.petCandy + @SubscribeEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return - if (!SkyHanniMod.feature.misc.petCandyUsed) return + if (!config.showCandy) return + + if (config.hideOnMaxed) { + if (stack.getPetLevel() == stack.getMaxPetLevel()) return + } val petCandyUsed = stack.getPetCandyUsed() ?: return if (petCandyUsed == 0) return @@ -24,4 +33,9 @@ class PetCandyUsedDisplay { event.drawSlotText(x, y, stackTip, .9f) } + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(22, "misc.petCandyUsed", "misc.petCandy.showCandy") + } } |
