From 4a6e2b16fc0171124c2a900751a34f71c5e470cd Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Sat, 1 Jun 2024 13:13:37 +0200 Subject: Feature: Beacon Power Display (#1901) Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> --- .../hannibal2/skyhanni/features/gui/BeaconPower.kt | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features/gui') diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt new file mode 100644 index 000000000..04ab13333 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/BeaconPower.kt @@ -0,0 +1,119 @@ +package at.hannibal2.skyhanni.features.gui + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.events.InventoryUpdatedEvent +import at.hannibal2.skyhanni.events.SecondPassedEvent +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher +import at.hannibal2.skyhanni.utils.RegexUtils.matches +import at.hannibal2.skyhanni.utils.RenderUtils.renderString +import at.hannibal2.skyhanni.utils.SimpleTimeMark +import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark +import at.hannibal2.skyhanni.utils.TimeUtils +import at.hannibal2.skyhanni.utils.TimeUtils.format +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class BeaconPower { + + private val storage get() = ProfileStorageData.profileSpecific?.beaconPower + private val config get() = SkyHanniMod.feature.gui + + private val group = RepoPattern.group("gui.beaconpower") + + private val deactivatedPattern by group.pattern( + "deactivated", + "§7Beacon Deactivated §8- §cNo Power Remaining" + ) + private val timeRemainingPattern by group.pattern( + "time", + "§7Power Remaining: §e(?