diff options
Diffstat (limited to 'src/main/java/at')
4 files changed, 57 insertions, 31 deletions
diff --git a/src/main/java/at/lorenz/mod/LorenzMod.java b/src/main/java/at/lorenz/mod/LorenzMod.java index 4a12e16db..2ffcbc468 100644 --- a/src/main/java/at/lorenz/mod/LorenzMod.java +++ b/src/main/java/at/lorenz/mod/LorenzMod.java @@ -67,6 +67,7 @@ public class LorenzMod { MinecraftForge.EVENT_BUS.register(new DungeonMilestoneDisplay()); MinecraftForge.EVENT_BUS.register(new DungeonDeathCounter()); MinecraftForge.EVENT_BUS.register(new DungeonCleanEnd()); + MinecraftForge.EVENT_BUS.register(new DungeonBossMessages()); Commands.init(); diff --git a/src/main/java/at/lorenz/mod/config/Features.java b/src/main/java/at/lorenz/mod/config/Features.java index 20b9ecad8..2cc8f6535 100644 --- a/src/main/java/at/lorenz/mod/config/Features.java +++ b/src/main/java/at/lorenz/mod/config/Features.java @@ -118,6 +118,11 @@ public class Features { @ConfigOption(name = "Dungeon Filter", desc = "Hide annoying messages inside dungeon.") @ConfigEditorBoolean public boolean dungeonMessages = false; + + @Expose + @ConfigOption(name = "Dungeon Boss Messages", desc = "Hide messages from watcher and bosses inside dungeon.") + @ConfigEditorBoolean + public boolean dungeonBossMessages = false; } public static class Dungeon { diff --git a/src/main/java/at/lorenz/mod/dungeon/DungeonBossMessages.kt b/src/main/java/at/lorenz/mod/dungeon/DungeonBossMessages.kt new file mode 100644 index 000000000..43c66e59c --- /dev/null +++ b/src/main/java/at/lorenz/mod/dungeon/DungeonBossMessages.kt @@ -0,0 +1,51 @@ +package at.lorenz.mod.dungeon + +import at.lorenz.mod.LorenzMod +import at.lorenz.mod.events.LorenzChatEvent +import at.lorenz.mod.utils.LorenzUtils +import at.lorenz.mod.utils.LorenzUtils.matchRegex +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class DungeonBossMessages { + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!LorenzUtils.inSkyblock) return + + if (!LorenzMod.feature.chat.dungeonBossMessages) return + + if (isBoss(event.message)) { + event.blockedReason = "dungeon_boss" + } + } + + private fun isBoss(message: String): Boolean { + when { + message.matchRegex("§([cd4])\\[BOSS] (.*)") -> { + when { + message.contains(" The Watcher§r§f: ") -> return true + message.contains(" Bonzo§r§f: ") -> return true + message.contains(" Scarf§r§f:") -> return true + message.contains("Professor§r§f") -> return true + message.contains(" Livid§r§f: ") || message.contains(" Enderman§r§f: ") -> return true + message.contains(" Thorn§r§f: ") -> return true + message.contains(" Sadan§r§f: ") -> return true + message.contains(" Maxor§r§c: ") -> return true + message.contains(" Storm§r§c: ") -> return true + message.contains(" Goldor§r§c: ") -> return true + message.contains(" Necron§r§c: ") -> return true + message.contains(" §r§4§kWither King§r§c:") -> return true + + message.endsWith(" Necron§r§c: That is enough, fool!") -> return true + message.endsWith(" Necron§r§c: Adventurers! Be careful of who you are messing with..") -> return true + message.endsWith(" Necron§r§c: Before I have to deal with you myself.") -> return true + } + } + + //M7 - Dragons + message == "§cThe Crystal withers your soul as you hold it in your hands!" -> return true + message == "§cIt doesn't seem like that is supposed to go there." -> return true + } + return false + } +}
\ No newline at end of file diff --git a/src/main/java/at/lorenz/mod/dungeon/DungeonChatFilter.kt b/src/main/java/at/lorenz/mod/dungeon/DungeonChatFilter.kt index bdf0addb4..65a187816 100644 --- a/src/main/java/at/lorenz/mod/dungeon/DungeonChatFilter.kt +++ b/src/main/java/at/lorenz/mod/dungeon/DungeonChatFilter.kt @@ -38,7 +38,6 @@ class DungeonChatFilter { isDamage(message) -> "damage" isAbility(message) -> "ability" isPuzzle(message) -> "puzzle" - isBoss(message) -> "boss" isEnd(message) -> "end" else -> "" @@ -47,36 +46,6 @@ class DungeonChatFilter { private fun isDoor(message: String): Boolean = message == "§cThe §r§c§lBLOOD DOOR§r§c has been opened!" - private fun isBoss(message: String): Boolean { - when { - message.matchRegex("§([cd4])\\[BOSS] (.*)") -> { - when { - message.contains(" The Watcher§r§f: ") -> return true - message.contains(" Bonzo§r§f: ") -> return true - message.contains(" Scarf§r§f:") -> return true - message.contains("Professor§r§f") -> return true - message.contains(" Livid§r§f: ") || message.contains(" Enderman§r§f: ") -> return true - message.contains(" Thorn§r§f: ") -> return true - message.contains(" Sadan§r§f: ") -> return true - message.contains(" Maxor§r§c: ") -> return true - message.contains(" Storm§r§c: ") -> return true - message.contains(" Goldor§r§c: ") -> return true - message.contains(" Necron§r§c: ") -> return true - message.contains(" §r§4§kWither King§r§c:") -> return true - - message.endsWith(" Necron§r§c: That is enough, fool!") -> return true - message.endsWith(" Necron§r§c: Adventurers! Be careful of who you are messing with..") -> return true - message.endsWith(" Necron§r§c: Before I have to deal with you myself.") -> return true - } - } - - //M7 - Dragons - message == "§cThe Crystal withers your soul as you hold it in your hands!" -> return true - message == "§cIt doesn't seem like that is supposed to go there." -> return true - } - return false - } - 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 |