Fix Tagging players and triggering a replacematcher not resetting chatcolor
This commit is contained in:
parent
4b930e62c3
commit
9d7f944c88
|
|
@ -110,7 +110,7 @@ public class ChatFilter {
|
|||
String group = matcher.group();
|
||||
modifiableString.replace(TextReplacementConfig.builder()
|
||||
.matchLiteral(group)
|
||||
.replacement(group.substring(0, length))
|
||||
.replacement(Component.text(group.substring(0, length), modifiableString.component().color()))
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
implementation(project(":api")) // API
|
||||
compileOnly("com.alttd:Galaxy-API:1.19.2-R0.1-SNAPSHOT") // Galaxy
|
||||
compileOnly("com.alttd:Galaxy-API:1.20.1-R0.1-SNAPSHOT") // Galaxy
|
||||
compileOnly("com.gitlab.ruany:LiteBansAPI:0.3.5") // move to proxy
|
||||
compileOnly("org.apache.commons:commons-lang3:3.12.0") // needs an alternative, already removed from upstream api and will be removed in server
|
||||
compileOnly("net.luckperms:api:5.3") // Luckperms
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import io.papermc.paper.event.player.AsyncChatEvent;
|
|||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.PatternReplacementResult;
|
||||
import net.kyori.adventure.text.TextReplacementConfig;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
|
|
@ -81,7 +82,7 @@ public class ChatListener implements Listener {
|
|||
.filter(receiver -> !ChatUserManager.getChatUser(receiver.getUniqueId()).getIgnoredPlayers().contains(player.getUniqueId()))
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
Component input = event.message();
|
||||
Component input = event.message().colorIfAbsent(NamedTextColor.WHITE);
|
||||
|
||||
ModifiableString modifiableString = new ModifiableString(input);
|
||||
// todo a better way for this
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user