This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from MrSam7K/main
hide plot boosts in streamer mode
- Loading branch information
Showing
6 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...java/io/github/homchom/recode/mod/features/social/chat/message/checks/PlotBoostCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.github.homchom.recode.mod.features.social.chat.message.checks; | ||
|
||
import io.github.homchom.recode.mod.features.social.chat.message.LegacyMessage; | ||
import io.github.homchom.recode.mod.features.social.chat.message.LegacyMessageType; | ||
import io.github.homchom.recode.mod.features.social.chat.message.MessageCheck; | ||
import io.github.homchom.recode.mod.features.streamer.StreamerModeHandler; | ||
import io.github.homchom.recode.mod.features.streamer.StreamerModeMessageCheck; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public class PlotBoostCheck extends MessageCheck implements StreamerModeMessageCheck { | ||
|
||
private static final Pattern PLOT_BOOST_REGEX = Pattern.compile("\n {78}\n(.+)\n {29}\u200c→ Click to join!\n {78}"); | ||
|
||
@Override | ||
public LegacyMessageType getType() { | ||
return LegacyMessageType.PLOT_BOOST; | ||
} | ||
|
||
@Override | ||
public boolean check(LegacyMessage message, String stripped) { | ||
return PLOT_BOOST_REGEX.matcher(stripped).matches(); | ||
} | ||
|
||
@Override | ||
public void onReceive(LegacyMessage message) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean streamerHideEnabled() { | ||
return StreamerModeHandler.hidePlotBoosts(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters