diff options
author | HiZe_ <superhize@hotmail.com> | 2023-06-09 23:22:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-09 23:22:16 +0200 |
commit | fd21e3c6f7c40f92972f594b2724950e036986a9 (patch) | |
tree | 248b8210a911e5864ee500a13aa4f771fbf2f282 /src/main/java/at/hannibal2 | |
parent | 40703a977119cd83f6975d873728e756e46e0cc7 (diff) | |
download | skyhanni-fd21e3c6f7c40f92972f594b2724950e036986a9.tar.gz skyhanni-fd21e3c6f7c40f92972f594b2724950e036986a9.tar.bz2 skyhanni-fd21e3c6f7c40f92972f594b2724950e036986a9.zip |
Restore Bought Piece Of Wizard Portal Lore (#225)
Diffstat (limited to 'src/main/java/at/hannibal2')
4 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index b4a9ebe75..9cdb71fa5 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -295,6 +295,7 @@ class SkyHanniMod { loadModule(SlayerItemProfitTracker()) loadModule(SlayerItemsOnGround()) loadModule(DetectBrokenHyperion()) + loadModule(RestorePieceOfWizardPortalLore()) init() diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java index 73ef39593..fbb623f44 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -508,5 +508,10 @@ public class Misc { public boolean configButtonOnPause = true; @Expose + @ConfigOption(name = "Piece Of Wizard Portal", desc = "Restore the Earned By lore line on bought Piece Of Wizard Portal.") + @ConfigEditorBoolean + public boolean restorePieceOfWizardPortalLore = true; + + @Expose public Position inventoryLoadPos = new Position(394, 124, false, true); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt new file mode 100644 index 000000000..01810d729 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/RestorePieceOfWizardPortalLore.kt @@ -0,0 +1,24 @@ +package at.hannibal2.skyhanni.features.misc + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzToolTipEvent +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getRecipientName +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class RestorePieceOfWizardPortalLore { + + private val config get() = SkyHanniMod.feature.misc + + @SubscribeEvent + fun onTooltip(event: LorenzToolTipEvent) { + if (!config.restorePieceOfWizardPortalLore) return + val stack = event.itemStack + if (stack.getInternalName() != "WIZARD_PORTAL_MEMENTO") return + val recipient = stack.getRecipientName() + if (!event.toolTip[5].contains(recipient!!)) { + event.toolTip.add(5, "ยง7Earned by: $recipient") + } + } + +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 19177aaa5..cd0d33f96 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -153,6 +153,8 @@ object SkyBlockItemModifierUtils { return data.sackInASack } + fun ItemStack.getRecipientName() = getAttributeString("recipient_name") + fun ItemStack.getGemstones() = getExtraAttributes()?.let { val list = mutableListOf<GemstoneSlot>() for (attributes in it.keySet) { |