From afc0c5bb720b57ea8f278cf2a432c37137821d00 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 7 Sep 2022 09:34:10 +0200 Subject: fixed regex --- src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index 412114c58..62d842cba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -72,7 +72,7 @@ class ChatFilter { } private fun uselessNotification(message: String): Boolean { - if (message.matchRegex("§aYou tipped (\\d) (player|players)!")) return true + if (message.matchRegex("§aYou tipped (\\d+) (player|players)!")) return true return when (message) { "§eYour previous §r§6Plasmaflux Power Orb §r§ewas removed!" -> true -- cgit From 5c016b2a7cf85d57698ec2e0ed73bf34cce50946 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 7 Sep 2022 09:37:18 +0200 Subject: code cleanup --- .../java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index 62d842cba..3d9835910 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -66,9 +66,9 @@ class ChatFilter { message.matchRegex("§aFriend > §r(.*) §r§e(joined|left).") -> { true } + else -> false } - } private fun uselessNotification(message: String): Boolean { @@ -225,7 +225,9 @@ class ChatFilter { //Bank "§8Depositing coins...", - "§8Withdrawing coins..." -> true + "§8Withdrawing coins...", + -> true + else -> false } @@ -296,7 +298,9 @@ class ChatFilter { "", "§f", - "§c" -> true + "§c", + -> true + else -> false } } -- cgit From 2d0f63b156f936e9f056537a67eaa13bffa54c27 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 7 Sep 2022 11:02:13 +0200 Subject: SummoningSoulsName integrate into SummoningMobManager config logic --- .../java/at/hannibal2/skyhanni/features/SummoningMobManager.kt | 9 +++++++++ .../java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt index 36dbab9ed..03d9382d1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt @@ -36,6 +36,9 @@ class SummoningMobManager { //§a§ohannibal2's Tank Zombie§r §a160k§c❤ private val healthPattern = Pattern.compile("§a§o(.+)'s (.+)§r §[ae]([\\dkm]+)§c❤") + //§cThe Seraph recalled your 3 summoned allies! + private val seraphRecallPattern = Pattern.compile("§cThe Seraph recalled your (\\d) summoned allies!") + @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { if (!LorenzUtils.isOnHypixel) return @@ -57,6 +60,12 @@ class SummoningMobManager { event.blockedReason = "summoning_soul" } } + if (message == "§cThe Seraph recalled your summoned ally!" || seraphRecallPattern.matcher(message).matches()) { + despawned() + if (SkyHanniMod.feature.abilities.summoningMobDisplay) { + event.blockedReason = "summoning_soul" + } + } } var tick = 0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt index ec813395a..59784f027 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt @@ -127,6 +127,6 @@ class SummoningSoulsName { } private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.misc.summonSoulDisplay + return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.summoningSoulDisplay } } \ No newline at end of file -- cgit From 163cc857b0b1e6f52d56e663b8cb1c55f5e1bff2 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 7 Sep 2022 11:42:48 +0200 Subject: Hiding the flame particles when using the Fire Veil Wand ability. --- .../skyhanni/features/FireVeilWandParticles.kt | 50 ++++++++++++++++++++++ .../skyhanni/features/diana/GriffinBurrowFinder.kt | 5 +-- .../skyhanni/features/dungeon/DungeonHideItems.kt | 8 ++-- 3 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt new file mode 100644 index 000000000..1205c202b --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt @@ -0,0 +1,50 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.ItemClickInHandEvent +import at.hannibal2.skyhanni.events.PacketEvent +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.network.play.server.S2APacketParticles +import net.minecraft.util.EnumParticleTypes +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class FireVeilWandParticles { + + var lastClick = 0L + + @SubscribeEvent + fun onChatPacket(event: PacketEvent.ReceiveEvent) { + if (!isEnabled()) return + + val packet = event.packet + if (packet !is S2APacketParticles) return + + if (System.currentTimeMillis() > lastClick + 5_500) return + + if (packet.particleType == EnumParticleTypes.FLAME && packet.particleCount == 1 && packet.particleSpeed == 0f && + packet.xOffset == 0f && + packet.yOffset == 0f && + packet.zOffset == 0f + ) { + event.isCanceled = true + } + } + + @SubscribeEvent + fun onItemClick(event: ItemClickInHandEvent) { + if (!isEnabled()) return + if (event.clickType != ItemClickInHandEvent.ClickType.RIGHT_CLICK) return + + val itemInHand = event.itemInHand ?: return + + val internalName = itemInHand.getInternalName() + if (internalName == "FIRE_VEIL_WAND") { + lastClick = System.currentTimeMillis() + } + } + + private fun isEnabled(): Boolean { + return LorenzUtils.inSkyblock && SkyHanniMod.feature.abilities.fireVeilWandHider + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/diana/GriffinBurrowFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/diana/GriffinBurrowFinder.kt index d98f46100..524a94259 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/diana/GriffinBurrowFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/diana/GriffinBurrowFinder.kt @@ -71,10 +71,7 @@ class GriffinBurrowFinder { fun onChatPacket(event: PacketEvent.ReceiveEvent) { val packet = event.packet if (packet is S2APacketParticles) { - val x = packet.xCoordinate - val y = packet.yCoordinate - val z = packet.zCoordinate - val distance = LorenzVec(x, y, z).distance(LocationUtils.playerLocation()) + val distance = packet.toLorenzVec().distance(LocationUtils.playerLocation()) if (distance < 20) { // LorenzDebug.log("") // LorenzDebug.log("S2APacketParticles close") diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt index faf48e95c..acc0de8a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -1,14 +1,14 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.data.EntityMovementHelper +import at.hannibal2.skyhanni.data.EntityMovementData import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.utils.ItemUtils.cleanName import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.getLorenzVec +import at.hannibal2.skyhanni.utils.toLorenzVec import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.item.EntityItem import net.minecraft.network.play.server.S2APacketParticles @@ -121,7 +121,7 @@ class DungeonHideItems { } if (isSkeletonSkull(entity)) { - EntityMovementHelper.addToTrack(entity) + EntityMovementData.addToTrack(entity) if (SkyHanniMod.feature.dungeon.hideSkeletonSkull) { val lastMove = movingSkeletonSkulls.getOrDefault(entity, 0) if (lastMove + 100 > System.currentTimeMillis()) { @@ -139,7 +139,7 @@ class DungeonHideItems { val packet = event.packet if (packet is S2APacketParticles) { - val packetLocation = LorenzVec(packet.xCoordinate, packet.yCoordinate, packet.zCoordinate) + val packetLocation = packet.toLorenzVec() for (armorStand in hideParticles.filter { it.value + 100 > System.currentTimeMillis() }.map { it.key }) { val distance = packetLocation.distance(armorStand.getLorenzVec()) if (distance < 2) { -- cgit From e1c1b44f1ab432827233ba44b0f03d67340f994a Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 7 Sep 2022 12:51:29 +0200 Subject: Fixed enchanted books in bazaar. --- .../java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt | 9 ++++++--- .../hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt | 12 +++++++++++- .../skyhanni/features/items/HideNotClickableItems.kt | 3 +-- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt index 5ae100ac2..c2c8bcb18 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt @@ -1,7 +1,9 @@ package at.hannibal2.skyhanni.features.bazaar +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import net.minecraft.item.ItemStack class BazaarApi { @@ -44,9 +46,10 @@ class BazaarApi { return null } - fun isBazaarItem(name: String): Boolean { - val bazaarName = getCleanBazaarName(name) - return bazaarMap.containsKey(bazaarName) + fun isBazaarItem(stack: ItemStack): Boolean { + val internalName = stack.getInternalName() + return bazaarMap.any { it.value.apiName == internalName } + } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt index 01f01015c..642298ba5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt @@ -85,7 +85,7 @@ internal class BazaarDataGrabber(private var bazaarMap: MutableMap