diff options
3 files changed, 21 insertions, 0 deletions
diff --git a/Update Notes/2.1.1.md b/Update Notes/2.1.1.md index f4270ba7..1f4e0311 100644 --- a/Update Notes/2.1.1.md +++ b/Update Notes/2.1.1.md @@ -17,3 +17,4 @@ - Allow custom delays until skill overlays pause - cobble8 - Add exponent and percentage to calculator - u9g - Add total trophy fish count to /pv - Vixid + - Allow hiding messages below a set skyblock level - nopo diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index 3473124c..e3a3edad 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -53,6 +53,8 @@ public class ChatListener { private final NotEnoughUpdates neu; private static final Pattern SLAYER_XP = Pattern.compile( " (Spider|Zombie|Wolf|Enderman|Blaze) Slayer LVL (\\d) - (?:Next LVL in ([\\d,]+) XP!|LVL MAXED OUT!)"); + + private static final Pattern SKYBLOCK_LVL_MESSAGE = Pattern.compile("\\[(\\d{1,4})\\] .*"); AtomicBoolean missingRecipe = new AtomicBoolean(false); public ChatListener(NotEnoughUpdates neu) { @@ -254,5 +256,11 @@ public class ChatListener { unformatted.startsWith(" ") || unformatted.startsWith("✦") || unformatted.equals( " You've earned a Crystal Loot Bundle!")) OverlayManager.crystalHollowOverlay.message(unformatted); + Matcher LvlMatcher = SKYBLOCK_LVL_MESSAGE.matcher(unformatted); + if (LvlMatcher.matches()) { + if (Integer.parseInt(LvlMatcher.group(1)) < NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel && NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel != 0) { + e.setCanceled(true); + } + } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index 86c4c5dd..568f852e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -239,6 +239,18 @@ public class Misc { @Expose @ConfigOption( + name = "Filter Skyblock Levels in Chat", + desc = "Requires the \"SkyBlock Levels in Chat\" skyblock setting to be on" + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 300, + minStep = 10 + ) + public int filterChatLevel = 0; + + @Expose + @ConfigOption( name = "Enable text field tweaks", desc = "Allows the use of ctrl + z, ctrl + y and ctrl + Lshift + z in text fields" ) |