diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 7 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Garden.java | 44 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Misc.java | 18 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenRecentTeleportPadsDisplay.kt | 64 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/garden/GardenTeleportPadCompactName.kt) | 9 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadInventoryNumber.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt) | 11 |
6 files changed, 34 insertions, 119 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index a072d0297..d31d50325 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -43,6 +43,8 @@ import at.hannibal2.skyhanni.features.minion.MinionCollectLogic import at.hannibal2.skyhanni.features.minion.MinionFeatures import at.hannibal2.skyhanni.features.misc.* import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager +import at.hannibal2.skyhanni.features.misc.teleportpad.TeleportPadCompactName +import at.hannibal2.skyhanni.features.misc.teleportpad.TeleportPadInventoryNumber import at.hannibal2.skyhanni.features.misc.tiarelay.TiaRelayHelper import at.hannibal2.skyhanni.features.misc.tiarelay.TiaRelayWaypoints import at.hannibal2.skyhanni.features.misc.trevor.TrevorFeatures @@ -244,7 +246,7 @@ class SkyHanniMod { loadModule(FarmingArmorDrops()) loadModule(JoinCrystalHollows()) loadModule(GardenVisitorColorNames()) - loadModule(GardenTeleportPadCompactName()) + loadModule(TeleportPadCompactName()) loadModule(AnitaMedalProfit()) loadModule(ComposterDisplay()) loadModule(GardenComposterInventoryFeatures()) @@ -256,7 +258,7 @@ class SkyHanniMod { loadModule(ToolTooltipTweaks()) loadModule(CropSpeedMeter()) loadModule(AshfangMinisNametagHider()) - loadModule(GardenTeleportPadInventoryNumber()) + loadModule(TeleportPadInventoryNumber()) loadModule(ComposterOverlay()) loadModule(DiscordRPCManager) loadModule(GardenCropMilestoneFix()) @@ -267,7 +269,6 @@ class SkyHanniMod { loadModule(GardenYawAndPitch()) loadModule(MovementSpeedDisplay()) loadModule(ChumBucketHider()) - loadModule(GardenRecentTeleportPadsDisplay()) loadModule(InquisitorWaypointShare) loadModule(TrevorFeatures()) loadModule(TrevorSolver) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index 4c63164fb..ff5febe26 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -892,50 +892,6 @@ public class Garden { public Position farmingArmorDropsPos = new Position(16, -232, false, true); @Expose - @ConfigOption(name = "Teleport Pads", desc = "") - @ConfigEditorAccordion(id = 19) - public boolean teleportPads = false; - - @Expose - @ConfigOption(name = "Compact Name", desc = "Hide the 'Warp to' and 'No Destination' texts over teleport pads.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 19) - public boolean teleportPadsCompactName = false; - - @Expose - @ConfigOption(name = "Inventory Numbers", desc = "Show the number of the teleport pads inside the 'Change Destination' inventory as stack size.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 19) - public boolean teleportPadsInventoryNumbers = false; - - @Expose - @ConfigOption(name = "Recent Teleport Pad Display", desc = "") - @Accordion - @ConfigAccordionId(id = 19) - public RecentTeleportPads teleportPadsRecentDisplay = new RecentTeleportPads(); - - public static class RecentTeleportPads { - - @Expose - @ConfigOption(name = "Enabled", desc = "Show the recent teleport pads used in a display.") - @ConfigEditorBoolean - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Only Target", desc = "Hide the 'From' part of the display.") - @ConfigEditorBoolean - public Property<Boolean> onlyTarget = Property.of(false); - - @Expose - @ConfigOption(name = "Hide Chat", desc = "Hide teleport pad chat messages.") - @ConfigEditorBoolean - public boolean hideChat = false; - - @Expose - public Position pos = new Position(206, 158, false, true); - } - - @Expose @ConfigOption(name = "Anita Medal Profit", desc = "") @ConfigEditorAccordion(id = 16) public boolean anitaMedalProfit = false; 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 07e2a92c1..82a7ee060 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Misc.java @@ -342,6 +342,24 @@ public class Misc { public boolean trapperTalkCooldown = true; } + @ConfigOption(name = "Teleport Pads", desc = "") + @Accordion + @Expose + public TeleportPad teleportPad = new TeleportPad(); + + public static class TeleportPad { + + @Expose + @ConfigOption(name = "Compact Name", desc = "Hide the 'Warp to' and 'No Destination' texts over teleport pads.") + @ConfigEditorBoolean + public boolean compactName = false; + + @Expose + @ConfigOption(name = "Inventory Numbers", desc = "Show the number of the teleport pads inside the 'Change Destination' inventory as stack size.") + @ConfigEditorBoolean + public boolean inventoryNumbers = false; + } + @Expose @ConfigOption(name = "Exp Bottles", desc = "Hides all the experience orbs lying on the ground.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenRecentTeleportPadsDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenRecentTeleportPadsDisplay.kt deleted file mode 100644 index c57c38924..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenRecentTeleportPadsDisplay.kt +++ /dev/null @@ -1,64 +0,0 @@ -package at.hannibal2.skyhanni.features.garden - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.utils.LorenzUtils.onToggle -import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings -import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class GardenRecentTeleportPadsDisplay { - private val config get() = SkyHanniMod.feature.garden.teleportPadsRecentDisplay - private var display = listOf<String>() - private var recentTeleports = mutableListOf<Pair<String, String>>() - private val pattern = - "§aWarped from the §r(?<from>.*) Teleport Pad§r§a to the §r(?<to>.*) Teleport Pad§r§a!".toPattern() - - @SubscribeEvent - fun onChat(event: LorenzChatEvent) { - if (!GardenAPI.inGarden()) return - - pattern.matchMatcher(event.message) { - if (config.enabled) { - recentTeleports.add(Pair(group("from"), group("to"))) - if (recentTeleports.size > 3) recentTeleports.removeFirst() - update() - } - - if (config.hideChat) { - event.blockedReason = "recent_teleport_pads" - } - } - } - - private fun update() { - display = buildList { - add("§6Recent TPs") - for ((from, to) in recentTeleports) { - if (config.onlyTarget.get()) { - add(to) - } else { - add(" $from §7➜ $to") - } - } - } - } - - @SubscribeEvent - fun onConfigLoad(event: ConfigLoadEvent) { - config.onlyTarget.onToggle { - update() - } - } - - @SubscribeEvent - fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) { - if (!isEnabled()) return - - config.pos.renderStrings(display, posLabel = "Recent Teleport Pads Display") - } - - fun isEnabled() = GardenAPI.inGarden() && config.enabled -} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenTeleportPadCompactName.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt index a23177f39..d09beb3c1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenTeleportPadCompactName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt @@ -1,6 +1,8 @@ -package at.hannibal2.skyhanni.features.garden +package at.hannibal2.skyhanni.features.misc.teleportpad import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand @@ -8,13 +10,14 @@ import net.minecraftforge.client.event.RenderLivingEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -class GardenTeleportPadCompactName { +class TeleportPadCompactName { private val patternName = "§.✦ §aWarp To (?<name>.*)".toPattern() private val patternNoName = "§.✦ §cNo Destination".toPattern() @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLivingB(event: RenderLivingEvent.Specials.Pre<EntityLivingBase>) { - if (!SkyHanniMod.feature.garden.teleportPadsCompactName) return + if (!SkyHanniMod.feature.misc.teleportPad.compactName) return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return val entity = event.entity if (entity !is EntityArmorStand) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadInventoryNumber.kt index 5dc226327..ba9c78321 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenTeleportPadInventoryNumber.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadInventoryNumber.kt @@ -1,14 +1,15 @@ -package at.hannibal2.skyhanni.features.garden.inventory +package at.hannibal2.skyhanni.features.misc.teleportpad import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent -import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ItemUtils.name +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -class GardenTeleportPadInventoryNumber { +class TeleportPadInventoryNumber { private val numbers: Map<String, Int> by lazy { val baseNumber = mapOf( "one" to 1, @@ -63,12 +64,12 @@ class GardenTeleportPadInventoryNumber { @SubscribeEvent fun onInventoryOpen(event: InventoryOpenEvent) { inTeleportPad = - event.inventoryName == "Set Destination" && SkyHanniMod.feature.garden.teleportPadsInventoryNumbers + event.inventoryName == "Set Destination" && SkyHanniMod.feature.misc.teleportPad.inventoryNumbers } @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { - if (!GardenAPI.inGarden()) return + if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return if (!inTeleportPad) return val name = event.stack.name?.lowercase() ?: return |