diff options
Diffstat (limited to 'src/main/java/at')
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) { |