Send Player along with replaceText
This commit is contained in:
parent
befece04d9
commit
e0f7b159e8
|
|
@ -39,7 +39,7 @@ public class ChatHandler {
|
||||||
public void privateMessage(Player player, String target, String message) {
|
public void privateMessage(Player player, String target, String message) {
|
||||||
ChatUser user = ChatUserManager.getChatUser(player.getUniqueId());
|
ChatUser user = ChatUserManager.getChatUser(player.getUniqueId());
|
||||||
user.setReplyTarget(target);
|
user.setReplyTarget(target);
|
||||||
String updatedMessage = RegexManager.replaceText(message); // todo a better way for this
|
String updatedMessage = RegexManager.replaceText(player, message); // todo a better way for this
|
||||||
if(updatedMessage == null) {
|
if(updatedMessage == null) {
|
||||||
Utils.sendBlockedNotification("DM Language", player, message, target);
|
Utils.sendBlockedNotification("DM Language", player, message, target);
|
||||||
return; // the message was blocked
|
return; // the message was blocked
|
||||||
|
|
@ -84,7 +84,7 @@ public class ChatHandler {
|
||||||
Component senderName = user.getDisplayName();
|
Component senderName = user.getDisplayName();
|
||||||
Component prefix = user.getPrefix();
|
Component prefix = user.getPrefix();
|
||||||
|
|
||||||
String updatedMessage = RegexManager.replaceText(message); // todo a better way for this
|
String updatedMessage = RegexManager.replaceText(player, message); // todo a better way for this
|
||||||
if(updatedMessage == null) {
|
if(updatedMessage == null) {
|
||||||
Utils.sendBlockedNotification("GC Language", player, message, "");
|
Utils.sendBlockedNotification("GC Language", player, message, "");
|
||||||
return; // the message was blocked
|
return; // the message was blocked
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class ChatListener implements Listener, ChatRenderer {
|
||||||
|
|
||||||
MiniMessage miniMessage = MiniMessage.get();
|
MiniMessage miniMessage = MiniMessage.get();
|
||||||
|
|
||||||
message = RegexManager.replaceText(message); // todo a better way for this
|
message = RegexManager.replaceText(event.getPlayer(), message); // todo a better way for this
|
||||||
if(message == null) {
|
if(message == null) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
Utils.sendBlockedNotification("Language", player, input, "");
|
Utils.sendBlockedNotification("Language", player, input, "");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user