mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-10 10:28:22 +01:00
We have added the ability for the Mute to contain a reason, which is stored for the duration of the mute in the user's data file. Currently we need to add in the mute reason code into some other commands such as /afk and /me and /seen ect. We will also need to fix a problem with the reason when we dont add in a time frame for the mute, which should mute the player indefinatly rather then cancelling the mute and throwing a DataFormat exception.
This commit is contained in:
parent
9378df0ff2
commit
4f8ea06db1
@ -80,7 +80,14 @@ public class EssentialsPlayerListener implements Listener {
|
||||
final User user = ess.getUser(event.getPlayer());
|
||||
if (user.isMuted()) {
|
||||
event.setCancelled(true);
|
||||
user.sendMessage(tl("voiceSilenced"));
|
||||
|
||||
if (user.getMuteReason ().equals ("")) {
|
||||
user.sendMessage(tl("voiceSilenced"));
|
||||
}
|
||||
else {
|
||||
user.sendMessage(tl("voiceSilenced") + tl("muteFormat", user.getMuteReason ()));
|
||||
}
|
||||
|
||||
LOGGER.info(tl("mutedUserSpeaks", user.getName(), event.getMessage()));
|
||||
}
|
||||
try {
|
||||
|
@ -538,6 +538,7 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
||||
setMuteTimeout(0);
|
||||
sendMessage(tl("canTalkAgain"));
|
||||
setMuted(false);
|
||||
setMuteReason ("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -522,8 +522,12 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
}
|
||||
|
||||
public void setMuteReason (String reason) {
|
||||
muteReason = reason;
|
||||
config.setProperty ("muteReason", reason);
|
||||
if (reason.equals("")) {
|
||||
config.removeProperty ("muteReason");
|
||||
} else {
|
||||
muteReason = reason;
|
||||
config.setProperty ("muteReason", reason);
|
||||
}
|
||||
config.save();
|
||||
}
|
||||
|
||||
|
@ -558,6 +558,7 @@ vanished=\u00a76You are now completely invisible to normal users, and hidden fro
|
||||
versionMismatch=\u00a74Version mismatch\! Please update {0} to the same version.
|
||||
versionMismatchAll=\u00a74Version mismatch\! Please update all Essentials jars to the same version.
|
||||
voiceSilenced=\u00a76Your voice has been silenced\!
|
||||
muteFormat=\u00a74 Reason: {0}
|
||||
walking=walking
|
||||
warpDeleteError=\u00a74Problem deleting the warp file.
|
||||
warpingTo=\u00a76Warping to\u00a7c {0}\u00a76.
|
||||
@ -601,4 +602,4 @@ worthSet=\u00a76Worth value set
|
||||
year=year
|
||||
years=years
|
||||
youAreHealed=\u00a76You have been healed.
|
||||
youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages\! Type \u00a7c/mail read\u00a76 to view your mail.
|
||||
youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages\! Type \u00a7c/mail read\u00a76 to view your mail.
|
||||
|
Loading…
Reference in New Issue
Block a user