Don't forget about reply

This commit is contained in:
destro174 2021-06-23 21:44:04 +02:00
parent b50e773536
commit 1e3095d396
4 changed files with 13 additions and 10 deletions

View File

@ -15,7 +15,7 @@ public class ChatUser {
private String staffPrefix; // doesn't need saving, we get this from luckperms
private String prefixAll; // doesn't need saving, we get this from luckperms
private boolean toggleGc; // should be saved, this toggles if the player can see and use global chat
private UUID replyTarget; // reply target for use in /msg i don't mind setting this to null on login, feedback?
private String replyTarget; // reply target for use in /msg i don't mind setting this to null on login, feedback?
private long gcCooldown; // the time when they last used gc, is used for the cooldown, i wouldn't save this, but setting this to the login time means they can't use gc for 30 seconds after logging in
private LinkedList<Mail> mails; // mails aren't finalized yet, so for now a table sender, reciever, sendtime, readtime(if emtpy mail isn't read yet?, could also do a byte to control this), the actual message
@ -102,11 +102,11 @@ public class ChatUser {
return toggleGc;
}
public UUID getReplyTarget() {
public String getReplyTarget() {
return replyTarget;
}
public void setReplyTarget(UUID replyTarget) {
public void setReplyTarget(String replyTarget) {
this.replyTarget = replyTarget;
}

View File

@ -67,7 +67,7 @@
</dependency>
</dependencies>
<properties>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
</project>

View File

@ -37,10 +37,7 @@ public class ChatHandler {
public void privateMessage(Player player, String target, String message) {
ChatUser user = ChatUserManager.getChatUser(player.getUniqueId());
Component senderName = player.displayName();
String prefix = user.getPrefix();
user.setReplyTarget(target);
message = RegexManager.replaceText(message); // todo a better way for this
if(message == null) return; // the message was blocked

View File

@ -8,4 +8,10 @@ commands:
globalchat:
permission: command.globalchat
permission-message: You do not have permission!
aliases: gc
aliases: gc
message:
permission: command.message
aliases: msg
reply:
permission: command.message
aliases: r