mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-25 09:31:52 +01:00
Added check to display mute reason when notifying
This commit is contained in:
parent
e05796f80e
commit
b0205b9499
@ -68,18 +68,41 @@ public class Commandmute extends EssentialsCommand {
|
|||||||
|
|
||||||
if (muted) {
|
if (muted) {
|
||||||
if (muteTimestamp > 0) {
|
if (muteTimestamp > 0) {
|
||||||
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime));
|
if (user.getMuteReason ().equals ("")) {
|
||||||
user.sendMessage(tl("playerMutedFor", muteTime));
|
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime));
|
||||||
|
user.sendMessage(tl("playerMutedFor", muteTime));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime) + tl("muteFormat",user.getMuteReason()));
|
||||||
|
user.sendMessage(tl("playerMutedFor", muteTime) + tl("muteFormat",user.getMuteReason()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(tl("mutedPlayer", user.getDisplayName()));
|
if (user.getMuteReason ().equals ("")) {
|
||||||
/** Send the player a message, why they were muted **/
|
sender.sendMessage(tl("mutedPlayer", user.getDisplayName()));
|
||||||
user.sendMessage(tl("playerMuted"));
|
/** Send the player a message, why they were muted **/
|
||||||
|
user.sendMessage(tl("playerMuted"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sender.sendMessage(tl("mutedPlayer", user.getDisplayName()) + tl("muteFormat",user.getMuteReason()));
|
||||||
|
/** Send the player a message, why they were muted **/
|
||||||
|
user.sendMessage(tl("playerMuted")+ tl("muteFormat",user.getMuteReason()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final String message;
|
final String message;
|
||||||
if (muteTimestamp > 0) {
|
if (muteTimestamp > 0) {
|
||||||
message = tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime);
|
if (user.getMuteReason ().equals ("")) {
|
||||||
|
message = tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message = (tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime) + tl("muteFormat",user.getMuteReason()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
message = tl("muteNotify", sender.getSender().getName(), user.getName());
|
if (user.getMuteReason ().equals ("")) {
|
||||||
|
message = tl("muteNotify", sender.getSender().getName(), user.getName());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message = (tl("muteNotify", sender.getSender().getName(), user.getName()) + tl("muteFormat",user.getMuteReason()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
server.getLogger().log(Level.INFO, message);
|
server.getLogger().log(Level.INFO, message);
|
||||||
ess.broadcastMessage("essentials.mute.notify", message);
|
ess.broadcastMessage("essentials.mute.notify", message);
|
||||||
|
Loading…
Reference in New Issue
Block a user