diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-17 17:14:07 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-17 17:14:07 +0200 |
commit | a403ad6d485d55e10da244e3ac824fc311f103cc (patch) | |
tree | 1317c6102f3650564429595622a681dd5b3fa0a3 /src/main/java | |
parent | 8457da3768343138dd13191d5ae27622c0eab3fb (diff) | |
download | skyhanni-a403ad6d485d55e10da244e3ac824fc311f103cc.tar.gz skyhanni-a403ad6d485d55e10da244e3ac824fc311f103cc.tar.bz2 skyhanni-a403ad6d485d55e10da244e3ac824fc311f103cc.zip |
Added click support for the missing visitor items display while inside signs (fill the item amount into the bazaar)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index aa6aaba5c..7f7b4967e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.visitor import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.TitleUtils import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.garden.CropType @@ -17,13 +18,16 @@ import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.drawString import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import at.hannibal2.skyhanni.utils.renderables.Renderable import io.github.moulberry.notenoughupdates.events.SlotClickEvent import io.github.moulberry.notenoughupdates.util.SBInfo import net.minecraft.client.Minecraft +import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.entity.Entity import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.network.play.client.C02PacketUseEntity +import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent import net.minecraftforge.client.event.RenderLivingEvent import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.event.entity.player.ItemTooltipEvent @@ -132,7 +136,10 @@ class GardenVisitorFeatures { val list = mutableListOf<Any>() list.add(" §7- ") list.add(itemStack) - list.add("$name §8x${amount.addSeparators()}") + + list.add(Renderable.link("$name §8x${amount.addSeparators()}") { + LorenzUtils.setTextIntoSign("$amount") + }) if (config.visitorNeedsShowPrice) { val price = NEUItems.getPrice(internalName) * amount @@ -538,6 +545,20 @@ class GardenVisitorFeatures { } @SubscribeEvent + fun onRenderInSigns(event: DrawScreenEvent.Post) { + if (!GardenAPI.inGarden()) return + if (!config.visitorNeedsDisplay) return + val gui = event.gui + if (gui !is GuiEditSign) return + + if (config.visitorNeedsOnlyWhenClose && !GardenAPI.onBarnPlot) return + + if (!GardenAPI.hideExtraGuis()) { + config.visitorNeedsPos.renderStringsAndItems(display, posLabel = "Visitor Items Needed") + } + } + + @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent) { if (!GardenAPI.inGarden()) return if (!config.visitorNeedsDisplay) return |