summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-07 05:09:48 +0200
committerGitHub <noreply@github.com>2022-09-07 05:09:48 +0200
commitcfeac0b6a71c592b61c53fad192eb22bb24b0f54 (patch)
tree2d4cbf11b8f5b93b6d907404399ffcd8ae08e763 /src/main/java/at/hannibal2/skyhanni/features
parent5b76d78b62420bfa5c9cca3cb3ebc50a12e812b7 (diff)
downloadskyhanni-cfeac0b6a71c592b61c53fad192eb22bb24b0f54.tar.gz
skyhanni-cfeac0b6a71c592b61c53fad192eb22bb24b0f54.tar.bz2
skyhanni-cfeac0b6a71c592b61c53fad192eb22bb24b0f54.zip
0.7 (#2)
* code cleanup * Option to hide the Skyblock Level from the chat messages, Option to change the way the Skyblock Level gets displayed in the chat * change version to 0.6.1 * add highlight the voidling extremist in pink color * add highlight corrupted mobs in purple color * fixed highlight corrupted mobs in purple color in the private island * another minor fix for highlight corrupted mobs in purple color * created EntityHealthUpdateEvent and fixing CorruptedMobHighlight * using EntityHealthUpdateEvent everywhere * added marking a player with yellow color * highlight slayer miniboss in blue color * /copyentities now shows health correctly for every entity * infer fix * fixing bazaar message filter * changelog * hides the death messages of other players, except for players who are close to the player. * hiding tip messages * highlight deathmites in dungeon in red color * code cleanup * code cleanup * hide tnt laying around in dungeon * fix infer * remove debug * Added hide Blessings laying around in dungeon. Added hide Revive Stones laying around in dungeon. * Hide Premium Flesh laying around in dungeon. * edited LorenzTest * Added dungeon copilot and separate filter for hiding dungeon key and door messages. * Added hide Journal Entry pages laying around in dungeon. * Added hide Skeleton Skulls laying around in dungeon. * credits * Added highlight Skeleton Skulls when combining into a skeleton in orange color (not useful combined with feature Hide Skeleton Skull) * Added highlight Skeleton Skulls when combining into a skeleton in orange color (not useful combined with feature Hide Skeleton Skull) * fix wording * clarification * small fixes * Highlight the enderman slayer Yang Glyph (Beacon) in red color (supports beacon in hand and beacon flying) * better/more readability for CopyNearbyEntitiesCommand * make version 0.7
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt61
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/PlayerMarker.kt90
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt27
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/HideFarDeathMessages.kt64
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt49
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt27
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt134
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt202
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt65
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/end/VoidlingExtremistColor.kt65
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/items/ItemStars.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/items/RngMeterInventory.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/items/abilitycooldown/ItemAbilityCooldown.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt134
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/HighlightSlayerMiniboss.kt92
25 files changed, 1045 insertions, 89 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt
new file mode 100644
index 000000000..cbad9c0e7
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/CorruptedMobHighlight.kt
@@ -0,0 +1,61 @@
+package at.hannibal2.skyhanni.features
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent
+import at.hannibal2.skyhanni.events.RenderMobColoredEvent
+import at.hannibal2.skyhanni.events.ResetEntityHurtEvent
+import at.hannibal2.skyhanni.events.withAlpha
+import at.hannibal2.skyhanni.utils.LorenzColor
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
+import net.minecraft.entity.EntityLivingBase
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class CorruptedMobHighlight {
+
+ private val corruptedMobs = mutableListOf<EntityLivingBase>()
+
+ @SubscribeEvent
+ fun onHealthUpdateEvent(event: EntityHealthUpdateEvent) {
+ if (!LorenzUtils.inSkyblock) return
+
+ val entity = event.entity
+ if (entity in corruptedMobs) return
+
+ val baseMaxHealth = entity.baseMaxHealth.toFloat()
+ if (event.health == baseMaxHealth * 3) {
+ corruptedMobs.add(entity)
+ }
+ }
+
+ @SubscribeEvent
+ fun onRenderMobColored(event: RenderMobColoredEvent) {
+ if (!isEnabled()) return
+ val entity = event.entity
+
+ if (entity in corruptedMobs) {
+ event.color = LorenzColor.DARK_PURPLE.toColor().withAlpha(127)
+ }
+ }
+
+ @SubscribeEvent
+ fun onResetEntityHurtTime(event: ResetEntityHurtEvent) {
+ if (!isEnabled()) return
+ val entity = event.entity
+
+ if (entity in corruptedMobs) {
+ event.shouldReset = true
+ }
+ }
+
+ @SubscribeEvent
+ fun onWorldChange(event: WorldEvent.Load) {
+ corruptedMobs.clear()
+ }
+
+ private fun isEnabled(): Boolean {
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.misc.corruptedMobHighlight &&
+ LorenzUtils.skyBlockIsland != "Private Island"
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/PlayerMarker.kt b/src/main/java/at/hannibal2/skyhanni/features/PlayerMarker.kt
new file mode 100644
index 000000000..e8a12a743
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/PlayerMarker.kt
@@ -0,0 +1,90 @@
+package at.hannibal2.skyhanni.features
+
+import at.hannibal2.skyhanni.events.RenderMobColoredEvent
+import at.hannibal2.skyhanni.events.ResetEntityHurtEvent
+import at.hannibal2.skyhanni.events.withAlpha
+import at.hannibal2.skyhanni.utils.LorenzColor
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraft.client.Minecraft
+import net.minecraft.client.entity.EntityOtherPlayerMP
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent
+
+class PlayerMarker {
+
+ companion object {
+ private val playerNamesToMark = mutableListOf<String>()
+ private val markedPlayers = mutableMapOf<String, EntityOtherPlayerMP>()
+
+ fun command(args: Array<String>) {
+ if (args.size != 1) {
+ LorenzUtils.chat("§cUsage: /shmarkplayer <name>")
+ return
+ }
+
+ val displayName = args[0]
+ val name = displayName.lowercase()
+ if (name !in playerNamesToMark) {
+ playerNamesToMark.add(name)
+ findPlayers()
+ LorenzUtils.chat("§e[SkyHanni] §amarked §eplayer §b$displayName!")
+ } else {
+ playerNamesToMark.remove(name)
+ markedPlayers.remove(name)
+ LorenzUtils.chat("§e[SkyHanni] §cunmarked §eplayer §b$displayName!")
+ }
+ }
+
+ private fun findPlayers() {
+ for (entity in Minecraft.getMinecraft().theWorld.loadedEntityList) {
+ if (entity is EntityOtherPlayerMP) {
+ if (entity in markedPlayers.values) continue
+
+ val name = entity.name.lowercase()
+ if (name in playerNamesToMark) {
+ markedPlayers[name] = entity
+ }
+ }
+ }
+ }
+ }
+
+ var tick = 0
+
+ @SubscribeEvent
+ fun onTick(event: TickEvent.ClientTickEvent) {
+ if (!isEnabled()) return
+
+ if (tick++ % 20 == 0) {
+ findPlayers()
+ }
+ }
+
+ @SubscribeEvent
+ fun onRenderMobColored(event: RenderMobColoredEvent) {
+ if (!isEnabled()) return
+ val entity = event.entity
+ if (entity in markedPlayers.values) {
+ event.color = LorenzColor.YELLOW.toColor().withAlpha(127)
+ }
+ }
+
+ @SubscribeEvent
+ fun onResetEntityHurtTime(event: ResetEntityHurtEvent) {
+ if (!isEnabled()) return
+ val entity = event.entity
+ if (entity in markedPlayers.values) {
+ event.shouldReset = true
+ }
+ }
+
+ @SubscribeEvent
+ fun onWorldChange(event: WorldEvent.Load) {
+ markedPlayers.clear()
+ }
+
+ private fun isEnabled(): Boolean {
+ return LorenzUtils.inSkyblock
+ }
+} \ 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 74cf7847b..36dbab9ed 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/SummoningMobManager.kt
@@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.RenderMobColoredEvent
-import at.hannibal2.skyhanni.events.ResetEntityHurtTimeEvent
+import at.hannibal2.skyhanni.events.ResetEntityHurtEvent
import at.hannibal2.skyhanni.events.withAlpha
import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth
@@ -177,7 +177,7 @@ class SummoningMobManager {
}
@SubscribeEvent
- fun onResetEntityHurtTime(event: ResetEntityHurtTimeEvent) {
+ fun onResetEntityHurtTime(event: ResetEntityHurtEvent) {
val entity = event.entity
if (SkyHanniMod.feature.abilities.summoningMobColored && entity in summoningMobs.keys) {
event.shouldReset = true
@@ -190,7 +190,6 @@ class SummoningMobManager {
summoningsSpawned = 0
searchArmorStands = false
searchMobs = false
- println("despawning")
}
private fun isEnabled(): Boolean {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt
index 1a659f171..ec813395a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt
@@ -12,22 +12,23 @@ import net.minecraft.client.Minecraft
import net.minecraft.entity.EntityLiving
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.client.event.RenderWorldLastEvent
+import net.minecraftforge.event.world.WorldEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
class SummoningSoulsName {
var tick = 0
- val texture =
+ private val texture =
"ewogICJ0aW1lc3RhbXAiIDogMTYwMTQ3OTI2NjczMywKICAicHJvZmlsZUlkIiA6ICJmMzA1ZjA5NDI0NTg0ZjU" +
"4YmEyYjY0ZjAyZDcyNDYyYyIsCiAgInByb2ZpbGVOYW1lIiA6ICJqcm9ja2EzMyIsCiAgInNpZ25hdH" +
"VyZVJlcXVpcmVkIiA6IHRydWUsCiAgInRleHR1cmVzIiA6IHsKICAgICJTS0lOIiA6IHsKICAgICAgI" +
"nVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS81YWY0MDM1ZWMwZGMx" +
"NjkxNzc4ZDVlOTU4NDAxNzAyMjdlYjllM2UyOTQzYmVhODUzOTI5Y2U5MjNjNTk4OWFkIgogICAgfQogIH0KfQ"
- val souls = mutableMapOf<EntityArmorStand, String>()
- val mobsLastLocation = mutableMapOf<EntityLiving, LorenzVec>()
- val mobsName = mutableMapOf<EntityLiving, String>()
+ private val souls = mutableMapOf<EntityArmorStand, String>()
+ private val mobsLastLocation = mutableMapOf<EntityLiving, LorenzVec>()
+ private val mobsName = mutableMapOf<EntityLiving, String>()
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
@@ -103,6 +104,13 @@ class SummoningSoulsName {
}
}
+ @SubscribeEvent
+ fun onWorldChange(event: WorldEvent.Load) {
+ souls.clear()
+ mobsLastLocation.clear()
+ mobsName.clear()
+ }
+
private fun isSoul(entity: EntityArmorStand): Boolean {
for (stack in entity.inventory) {
if (stack != null) {
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 4dc106249..412114c58 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
@@ -72,13 +72,13 @@ class ChatFilter {
}
private fun uselessNotification(message: String): Boolean {
- return when {
- message == "§eYour previous §r§6Plasmaflux Power Orb §r§ewas removed!" -> true
-
- message == "§aYou used your §r§6Mining Speed Boost §r§aPickaxe Ability!" -> true
- message == "§cYour Mining Speed Boost has expired!" -> true
- message == "§a§r§6Mining Speed Boost §r§ais now available!" -> true
+ if (message.matchRegex("§aYou tipped (\\d) (player|players)!")) return true
+ return when (message) {
+ "§eYour previous §r§6Plasmaflux Power Orb §r§ewas removed!" -> true
+ "§aYou used your §r§6Mining Speed Boost §r§aPickaxe Ability!" -> true
+ "§cYour Mining Speed Boost has expired!" -> true
+ "§a§r§6Mining Speed Boost §r§ais now available!" -> true
else -> false
}
}
@@ -92,7 +92,7 @@ class ChatFilter {
message == "§cPlace a Dungeon weapon or armor piece above the anvil to salvage it!" -> true
message == "§cWhoa! Slow down there!" -> true
message == "§cWait a moment before confirming!" -> true
- message == "§cYou need to be out of combat for 3 seconds before opening the SkyBlock Menu!" -> true//TODO prevent in the future
+ message == "§cYou cannot open the SkyBlock menu while in combat!" -> true
else -> false
}
@@ -206,21 +206,22 @@ class ChatFilter {
private fun bazaarAndAHMiniMessages(message: String): Boolean = when (message) {
"§7Putting item in escrow...",
- "§7Putting goods in escrow...",
"§7Putting coins in escrow...",
//Auction House
"§7Setting up the auction...",
"§7Processing purchase...",
- "§7Claiming order...",
"§7Processing bid...",
"§7Claiming BIN auction...",
//Bazaar
- "§7Submitting sell offer...",
- "§7Submitting buy order...",
- "§7Executing instant sell...",
- "§7Executing instant buy...",
+ "§6[Bazaar] §r§7Submitting sell offer...",
+ "§6[Bazaar] §r§7Submitting buy order...",
+ "§6[Bazaar] §r§7Executing instant sell...",
+ "§6[Bazaar] §r§7Executing instant buy...",
+ "§6[Bazaar] §r§7Cancelling order...",
+ "§6[Bazaar] §r§7Claiming order...",
+ "§6[Bazaar] §r§7Putting goods in escrow...",
//Bank
"§8Depositing coins...",
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/HideFarDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/HideFarDeathMessages.kt
new file mode 100644
index 000000000..0a3ead47d
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/HideFarDeathMessages.kt
@@ -0,0 +1,64 @@
+package at.hannibal2.skyhanni.features.chat
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.HypixelData
+import at.hannibal2.skyhanni.events.LorenzChatEvent
+import at.hannibal2.skyhanni.utils.LocationUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.getLorenzVec
+import net.minecraft.client.Minecraft
+import net.minecraft.client.entity.EntityOtherPlayerMP
+import net.minecraftforge.event.world.WorldEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.TickEvent
+import java.util.regex.Pattern
+
+class HideFarDeathMessages {
+
+ private var tick = 0
+ private val lastTimePlayerSeen = mutableMapOf<String, Long>()
+
+ //§c ☠ §r§7§r§bZeroHazel§r§7 was killed by §r§8§lAshfang§r§7§r§7.
+ private val pattern = Pattern.compile("§c ☠ §r§7§r§.(.+)§r§7 (.+)")
+
+ @SubscribeEvent
+ fun onTick(event: TickEvent.ClientTickEvent) {
+ if (!isEnabled()) return
+
+ if (tick++ % 20 == 0) {
+ checkOtherPlayers()
+ }
+ }
+
+ @SubscribeEvent
+ fun onChatMessage(event: LorenzChatEvent) {
+ if (!isEnabled()) return
+
+ val message = event.message
+ val matcher = pattern.matcher(message)
+ if (matcher.matches()) {
+ val name = matcher.group(1)
+ if (System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault(name, 0) + 30_000) {
+ event.blockedReason = "far_away_player_death"
+ }
+ }
+ }
+
+ @SubscribeEvent
+ fun onWorldChange(event: WorldEvent.Load) {
+ HypixelData.skyblock = false
+ }
+
+ private fun checkOtherPlayers() {
+ val location = LocationUtils.playerLocation()
+ for (otherPlayer in Minecraft.getMinecraft().theWorld.loadedEntityList
+ .filterIsInstance<EntityOtherPlayerMP>()
+ .filter { it.getLorenzVec().distance(location) < 25 }) {
+ lastTimePlayerSeen[otherPlayer.name] = System.currentTimeMillis()
+ }
+ }
+
+ private fun isEnabled(): Boolean {
+ return LorenzUtils.inSkyblock && SkyHanniMod.feature.chat.hideFarDeathMessages && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt
index ac6b9fbbe..a96997ba6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt
@@ -7,15 +7,18 @@ import at.hannibal2.skyhanni.utils.LorenzLogger
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.util.regex.Pattern
class PlayerChatFilter {
private val loggerPlayerChat = LorenzLogger("chat/player")
+ //§8[§9109§8] §b[MVP§c+§b] 4Apex§f§r§f: omg selling
+ private val patternSkyBlockLevel = Pattern.compile("§8\\[§(.)(\\d+)§8] (.+)")
+
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
if (!LorenzUtils.isOnHypixel) return
- if (!SkyHanniMod.feature.chat.playerMessages) return
if (shouldBlock(event.message)) {
event.blockedReason = "player_chat"
@@ -23,10 +26,19 @@ class PlayerChatFilter {
}
private fun shouldBlock(originalMessage: String): Boolean {
- val split = if (originalMessage.contains("§7§r§7: ")) {
- originalMessage.split("§7§r§7: ")
- } else if (originalMessage.contains("§f: ")) {
- originalMessage.split("§f: ")
+ //since hypixel sends own chat messages really weird " §r§8[§r§d205§r§8] §r§6[MVP§r§c++§r§6] hannibal2"
+ var rawMessage = originalMessage.replace("§r", "").trim()
+
+ val matcher = patternSkyBlockLevel.matcher(rawMessage)
+ if (matcher.matches()) {
+ SkyBlockLevelChatMessage.setData(matcher.group(2).toInt(), matcher.group(1))
+ rawMessage = matcher.group(3)
+ }
+
+ val split = if (rawMessage.contains("§7§7: ")) {
+ rawMessage.split("§7§7: ")
+ } else if (rawMessage.contains("§f: ")) {
+ rawMessage.split("§f: ")
} else {
return false
}
@@ -37,6 +49,14 @@ class PlayerChatFilter {
rawName = rawName.substring(channel.originalPrefix.length)
val name = grabName(rawName) ?: return false
+ if (!SkyHanniMod.feature.chat.playerMessagesFormat) {
+ if (SkyHanniMod.feature.chat.hideSkyblockLevel) {
+ LorenzUtils.chat(rawMessage)
+ return true
+ }
+ return false
+ }
+
val message = split[1]
send(channel, name.removeColor(), message.removeColor())
return true
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt
new file mode 100644
index 000000000..deacc0de6
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt
@@ -0,0 +1,49 @@
+package at.hannibal2.skyhanni.features.chat
+
+import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.events.PlayerSendChatEvent
+import at.hannibal2.skyhanni.utils.LorenzUtils
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+
+class SkyBlockLevelChatMessage {
+
+ companion object {
+ var level = -1
+ var levelColor = ""
+
+ fun setData(level: Int, levelColor: String) {
+ this.level = level
+ this.levelColor = levelColor
+ }
+ }
+
+ @SubscribeEvent
+ fun onChatMessage(event: PlayerSendChatEvent) {
+ if (level == -1) return
+ event.cancelledReason = "skyblock level"
+
+ val finalMessage = event.message
+ val name = event.playerName
+ val prefix = event.channel.prefix
+
+ if (SkyHanniMod.feature.chat.hideSkyblockLevel) {
+ LorenzUtils.chat("$prefix §b$name §f$finalMessage")
+ } else {
+
+ when (SkyHanniMod.feature.chat.skyblockLevelDesign) {
+ 0 -> {
+ LorenzUtils.chat("$prefix §8[§${levelColor}${level}§8] §b$name §f$finalMessage")
+ }
+
+ 1 -> {
+ LorenzUtils.chat("$prefix §${levelColor}§l${level} §b$name §f$finalMessage")
+ }
+
+ 2 -> {
+ LorenzUtils.chat("$prefix §b$name §8[§${levelColor}${level}§8]§f: $finalMessage")
+ }
+ }
+ }
+ level = -1
+ }
+} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt
index 109bfa9bc..c77738605 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt
@@ -62,7 +62,6 @@ enum class BossType(val fullName: String, val bossTypeToggle: Int, val shortName
* lost adventurer
* frozen adventurer
* king midas
- * silverfish 2b one tap - deathmite outside trap
* in blood room: bonzo, scarf, ??
* f7 blood room giants
*
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
index 3f9c88dac..a6fff41ca 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -42,6 +42,10 @@ class DamageIndicatorManager {
private var data = mutableMapOf<UUID, EntityData>()
private val damagePattern: Pattern = Pattern.compile("✧?(\\d+[⚔+✧❤♞☄✷ﬗ]*)")
+ fun isBoss(entity: EntityLivingBase): Boolean {
+ return data.values.any { it.entity == entity }
+ }
+
fun isDamageSplash(entity: EntityLivingBase): Boolean {
if (entity.ticksExisted > 300 || entity !is EntityArmorStand) return false
if (!entity.hasCustomName()) return false
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt
index 537a9850f..aa0af27b5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt
@@ -237,7 +237,7 @@ class MobFinder {
}
}
if (entity is EntityDragon) {
- //TODO testing and make right and so
+ //TODO testing and use sidebar data
return EntityResult(bossType = BossType.END_ENDER_DRAGON)
}
if (entity is EntityIronGolem) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt
index 0d3dcb77f..031cf41f5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt
@@ -29,8 +29,7 @@ class DungeonChatFilter {
if (!LorenzUtils.inDungeons) return ""
return when {
- isKey(message) -> "key"
- isDoor(message) -> "door"
+ isUnsortedBlockedMessage(message) -> "unsorted"
isPickup(message) -> "pickup"
isReminder(message) -> "reminder"
isBuff(message) -> "buff"
@@ -44,8 +43,6 @@ class DungeonChatFilter {
}
}
- private fun isDoor(message: String): Boolean = message == "§cThe §r§c§lBLOOD DOOR§r§c has been opened!"
-
private fun isEnd(message: String): Boolean = when {
message.matchRegex("(.*) §r§eunlocked §r§d(.*) Essence §r§8x(.*)§r§e!") -> true
message.matchRegex(" §r§d(.*) Essence §r§8x(.*)") -> true
@@ -58,6 +55,7 @@ class DungeonChatFilter {
message.matchRegex("§7Your Guided Sheep hit §r§c(.*) §r§7enemy for §r§c(.*) §r§7damage.") -> true
message == "§6Rapid Fire§r§a is ready to use! Press §r§6§lDROP§r§a to activate it!" -> true
message == "§6Castle of Stone§r§a is ready to use! Press §r§6§lDROP§r§a to activate it!" -> true
+ message == "§6Ragnarok§r§a is ready to use! Press §r§6§lDROP§r§a to activate it!" -> true
message.matchRegex("§a§lBUFF! §fYou were splashed by (.*) §fwith §r§cHealing VIII§r§f!") -> true
@@ -159,14 +157,10 @@ class DungeonChatFilter {
else -> false
}
- private fun isKey(message: String): Boolean = when {
- message.matchRegex("(.*) §r§ehas obtained §r§a§r§6§r§8Wither Key§r§e!") -> true
- message.matchRegex("(.*) opened a §r§8§lWITHER §r§adoor!") -> true
- message.matchRegex("(.*) §r§ehas obtained §r§a§r§c§r§cBlood Key§r§e!") -> true
+ //TODO sort out and filter separately
+ private fun isUnsortedBlockedMessage(message: String): Boolean = when {
message.matchRegex("(.*) §r§ehas obtained §r§a§r§9Beating Heart§r§e!") -> true
message == "§5A shiver runs down your spine..." -> true
- message == "§eA §r§a§r§6§r§8Wither Key§r§e was picked up!" -> true
- message == "§eA §r§a§r§c§r§cBlood Key§r§e was picked up!" -> true
else -> false
}
@@ -216,7 +210,7 @@ class DungeonChatFilter {
message == "§aYour active Potion Effects have been paused and stored. They will be restored when you leave Dungeons! You are not allowed to use existing Potion Effects while in Dungeons." -> true
message.matchRegex("(.*) has started the dungeon countdown. The dungeon will begin in 1 minute.") -> true
message.matchRegex("§e[NPC] §bMort§f: §rTalk to me to change your class and ready up.") -> true
- message.matchRegex("(.*) §a is now ready!") -> true
+ message.matchRegex("(.*)§a is now ready!") -> true
message.matchRegex("§aDungeon starts in (.*) seconds.") -> true
message == "§aDungeon starts in 1 second." -> true
message == "§aYou can no longer consume or splash any potions during the remainder of this Dungeon run!" -> true
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt
index bdaebc3f7..7222d080d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt
@@ -1,17 +1,13 @@
package at.hannibal2.skyhanni.features.dungeon
import at.hannibal2.skyhanni.SkyHanniMod
-import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
-import at.hannibal2.skyhanni.events.DamageIndicatorFinalBossEvent
-import at.hannibal2.skyhanni.events.LorenzChatEvent
-import at.hannibal2.skyhanni.events.PacketEvent
+import at.hannibal2.skyhanni.events.*
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex
import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.entity.item.EntityArmorStand
impo