From 5025043986350435d042f83a51007fc8c4495827 Mon Sep 17 00:00:00 2001 From: Empa <42304516+ItsEmpa@users.noreply.github.com> Date: Sat, 15 Jun 2024 11:15:17 +0200 Subject: Fix: World Boarder (#2102) --- .../features/dungeon/DungeonShadowAssassinNotification.kt | 7 ++++--- .../mixins/transformers/AccessorWorldBoarderPacket.java | 14 -------------- .../mixins/transformers/AccessorWorldBorderPacket.java | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBoarderPacket.java create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBorderPacket.java (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonShadowAssassinNotification.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonShadowAssassinNotification.kt index d96e4559f..ca888392f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonShadowAssassinNotification.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonShadowAssassinNotification.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent -import at.hannibal2.skyhanni.mixins.transformers.AccessorWorldBoarderPacket +import at.hannibal2.skyhanni.mixins.transformers.AccessorWorldBorderPacket import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.SoundUtils import net.minecraft.network.play.server.S44PacketWorldBorder @@ -13,14 +13,15 @@ import kotlin.time.Duration.Companion.seconds @SkyHanniModule object DungeonShadowAssassinNotification { + private val config get() = SkyHanniMod.feature.dungeon @HandleEvent(onlyOnIsland = IslandType.CATACOMBS) - fun onWorldBoarderChange(event: PacketReceivedEvent) { + fun onWorldBorderChange(event: PacketReceivedEvent) { if (!isEnabled()) return if (DungeonAPI.dungeonFloor?.contains("3") == true && DungeonAPI.inBossRoom) return - val packet = event.packet as? AccessorWorldBoarderPacket ?: return + val packet = event.packet as? AccessorWorldBorderPacket ?: return val action = packet.action val warningTime = packet.warningTime diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBoarderPacket.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBoarderPacket.java deleted file mode 100644 index b65841521..000000000 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBoarderPacket.java +++ /dev/null @@ -1,14 +0,0 @@ -package at.hannibal2.skyhanni.mixins.transformers; - -import net.minecraft.network.play.server.S44PacketWorldBorder; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(S44PacketWorldBorder.class) -public interface AccessorWorldBoarderPacket { - @Accessor("action") - S44PacketWorldBorder.Action getAction(); - - @Accessor("warningTime") - int getWarningTime(); -} diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBorderPacket.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBorderPacket.java new file mode 100644 index 000000000..7f29b397e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/AccessorWorldBorderPacket.java @@ -0,0 +1,14 @@ +package at.hannibal2.skyhanni.mixins.transformers; + +import net.minecraft.network.play.server.S44PacketWorldBorder; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(S44PacketWorldBorder.class) +public interface AccessorWorldBorderPacket { + @Accessor("action") + S44PacketWorldBorder.Action getAction(); + + @Accessor("warningTime") + int getWarningTime(); +} -- cgit