summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-09-07 12:58:45 +0200
committerLorenz <lo.scherf@gmail.com>2022-09-07 12:58:45 +0200
commit0dcd85d1103e5b8072aa97e186e986febbe6a60b (patch)
tree176539e2f9da95d3bbdb28739886b7ee06adc0b9 /src/main/java/at/hannibal2/skyhanni/features
parent9eac32ec67cd3a1ee5058322125f1350414c64ba (diff)
parenta1f6a1f7f0cda8e6234b4a9d7ea3b823d63049d3 (diff)
downloadskyhanni-0dcd85d1103e5b8072aa97e186e986febbe6a60b.tar.gz
skyhanni-0dcd85d1103e5b8072aa97e186e986febbe6a60b.tar.bz2
skyhanni-0dcd85d1103e5b8072aa97e186e986febbe6a60b.zip
Merge remote-tracking branch 'origin/dev' into dev
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/FireVeilWandParticles.kt50
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/diana/GriffinBurrowFinder.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/items/HideNotClickableItems.kt3
8 files changed, 80 insertions, 18 deletions
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/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
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/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
index 412114c58..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,13 +66,13 @@ class ChatFilter {
message.matchRegex("§aFriend > §r(.*) §r§e(joined|left).") -> {
true
}
+
else -> false
}
-
}
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
@@ -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
}
}
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) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/items/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/items/HideNotClickableItems.kt
index 549d347eb..2829742dc 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/items/HideNotClickableItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/items/HideNotClickableItems.kt
@@ -384,8 +384,7 @@ class HideNotClickableItems {
return true
}
- val displayName = stack.displayName
- if (bazaarInventory != BazaarApi.isBazaarItem(displayName)) {
+ if (bazaarInventory != BazaarApi.isBazaarItem(stack)) {
if (bazaarInventory) hideReason = "This item is not a Bazaar Product!"
if (auctionHouseInventory) hideReason = "Bazaar Products cannot be auctioned!"