aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java12
2 files changed, 20 insertions, 0 deletions
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"
)