From 30b3b6951ca9a29dd0ba27e0f34efad3b05a4aa4 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Wed, 6 Mar 2024 19:44:41 +1100 Subject: Backend: Use more isInIsland (#1107) --- .../java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt | 7 +++---- .../skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt | 4 ++-- .../features/misc/teleportpad/TeleportPadInventoryNumber.kt | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt index 4ee986dbf..c1bbb347a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt @@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LorenzColor -import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -24,7 +24,7 @@ class JoinCrystalHollows { val message = event.message if (message == "§cYou do not have an active Crystal Hollows pass!") { lastWrongPassTime = System.currentTimeMillis() - if (LorenzUtils.skyBlockIsland != IslandType.DWARVEN_MINES) { + if (!IslandType.DWARVEN_MINES.isInIsland()) { ChatUtils.clickableChat("Click here to warp to Dwarven Mines!", "warp mines") } else { ChatUtils.chat("Buy a §2Crystal Hollows Pass §efrom §5Gwendolyn") @@ -49,9 +49,8 @@ class JoinCrystalHollows { @SubscribeEvent fun onRenderWorld(event: LorenzRenderWorldEvent) { - if (!LorenzUtils.inSkyBlock) return + if (!IslandType.DWARVEN_MINES.isInIsland()) return if (!isEnabled()) return - if (LorenzUtils.skyBlockIsland != IslandType.DWARVEN_MINES) return if (inTime()) { val location = LorenzVec(88, 198, -99) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt index 7c0745a40..3b08970cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt @@ -2,7 +2,7 @@ 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.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.entity.EntityLivingBase @@ -24,8 +24,8 @@ class TeleportPadCompactName { @SubscribeEvent(priority = EventPriority.HIGH) fun onRenderLivingB(event: RenderLivingEvent.Specials.Pre) { + if (!IslandType.PRIVATE_ISLAND.isInIsland()) 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/misc/teleportpad/TeleportPadInventoryNumber.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadInventoryNumber.kt index dd2ddd91d..92b47fc53 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadInventoryNumber.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadInventoryNumber.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -75,7 +75,7 @@ class TeleportPadInventoryNumber { @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { - if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND) return + if (!IslandType.PRIVATE_ISLAND.isInIsland()) return if (!inTeleportPad) return val name = event.stack.name?.lowercase() ?: return -- cgit