mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-10 21:11:07 +01:00
commit
53c604c1b5
@ -81,12 +81,8 @@ public class EssentialsPlayerListener implements Listener {
|
|||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if (user.getMuteReason().equals ("")) {
|
user.sendMessage(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
user.sendMessage(tl("voiceSilenced"));
|
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
user.sendMessage(tl("voiceSilenced") + tl("muteReason", user.getMuteReason ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGER.info(tl("mutedUserSpeaks", user.getName(), event.getMessage()));
|
LOGGER.info(tl("mutedUserSpeaks", user.getName(), event.getMessage()));
|
||||||
}
|
}
|
||||||
|
@ -537,7 +537,7 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasMuteReason(){
|
public boolean hasMuteReason(){
|
||||||
return getMuteReason().equals("");
|
return !getMuteReason().equals("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private long muteTimeout;
|
private long muteTimeout;
|
||||||
|
@ -52,7 +52,7 @@ public class Commandafk extends EssentialsCommand {
|
|||||||
if (message != null && sender != null) {
|
if (message != null && sender != null) {
|
||||||
if (sender.isMuted()) {
|
if (sender.isMuted()) {
|
||||||
throw new Exception(tl("voiceSilenced") + (sender.hasMuteReason() ?
|
throw new Exception(tl("voiceSilenced") + (sender.hasMuteReason() ?
|
||||||
tl("muteReason", sender.getMuteReason()) : ""));
|
(" " + tl("muteReason", sender.getMuteReason())) : ""));
|
||||||
}
|
}
|
||||||
if (!sender.isAuthorized("essentials.afk.message")) {
|
if (!sender.isAuthorized("essentials.afk.message")) {
|
||||||
throw new Exception(tl("noPermToAFKMessage"));
|
throw new Exception(tl("noPermToAFKMessage"));
|
||||||
|
@ -49,7 +49,7 @@ public class Commandmail extends EssentialsCommand {
|
|||||||
|
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
tl("muteReason", user.getMuteReason()) : ""));
|
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
User u = getPlayer(server, args[1], true, true);
|
User u = getPlayer(server, args[1], true, true);
|
||||||
|
@ -25,7 +25,7 @@ public class Commandme extends EssentialsCommand {
|
|||||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception {
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception {
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
tl("muteReason", user.getMuteReason()) : ""));
|
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
|
@ -83,8 +83,8 @@ public class Commandmute extends EssentialsCommand {
|
|||||||
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime));
|
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime));
|
||||||
user.sendMessage(tl("playerMutedFor", muteTime));
|
user.sendMessage(tl("playerMutedFor", muteTime));
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime) + tl("muteReason",user.getMuteReason()));
|
sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime) + " " + tl("muteReason",user.getMuteReason()));
|
||||||
user.sendMessage(tl("playerMutedFor", muteTime) + tl("muteReason",user.getMuteReason()));
|
user.sendMessage(tl("playerMutedFor", muteTime) + " " + tl("muteReason",user.getMuteReason()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (user.getMuteReason ().equals ("")) {
|
if (user.getMuteReason ().equals ("")) {
|
||||||
@ -93,9 +93,9 @@ public class Commandmute extends EssentialsCommand {
|
|||||||
user.sendMessage(tl("playerMuted"));
|
user.sendMessage(tl("playerMuted"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(tl("mutedPlayer", user.getDisplayName()) + tl("muteReason",user.getMuteReason()));
|
sender.sendMessage(tl("mutedPlayer", user.getDisplayName()) + " " + tl("muteReason",user.getMuteReason()));
|
||||||
/** Send the player a message, why they were muted **/
|
/** Send the player a message, why they were muted **/
|
||||||
user.sendMessage(tl("playerMuted")+ tl("muteReason",user.getMuteReason()));
|
user.sendMessage(tl("playerMuted") + " " + tl("muteReason",user.getMuteReason()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final String message;
|
final String message;
|
||||||
@ -104,14 +104,14 @@ public class Commandmute extends EssentialsCommand {
|
|||||||
message = tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime);
|
message = tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message = (tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime) + tl("muteReason",user.getMuteReason()));
|
message = (tl("muteNotifyFor", sender.getSender().getName(), user.getName(), muteTime) + " " + tl("muteReason",user.getMuteReason()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (user.getMuteReason ().equals ("")) {
|
if (user.getMuteReason ().equals ("")) {
|
||||||
message = tl("muteNotify", sender.getSender().getName(), user.getName());
|
message = tl("muteNotify", sender.getSender().getName(), user.getName());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
message = (tl("muteNotify", sender.getSender().getName(), user.getName()) + tl("muteReason",user.getMuteReason()));
|
message = (tl("muteNotify", sender.getSender().getName(), user.getName()) + " " + tl("muteReason",user.getMuteReason()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server.getLogger().log(Level.INFO, message);
|
server.getLogger().log(Level.INFO, message);
|
||||||
|
@ -29,7 +29,7 @@ public class Commandr extends EssentialsCommand {
|
|||||||
|
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
tl("muteReason", user.getMuteReason()) : ""));
|
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
message = FormatUtil.formatMessage(user, "essentials.msg", message);
|
message = FormatUtil.formatMessage(user, "essentials.msg", message);
|
||||||
|
@ -117,8 +117,8 @@ public class Commandseen extends EssentialsCommand {
|
|||||||
sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true"))));
|
sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true"))));
|
||||||
}
|
}
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
throw new Exception(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ?
|
sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ?
|
||||||
tl("muteReason", user.getMuteReason()) : ""));
|
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||||
}
|
}
|
||||||
final String location = user.getGeoLocation();
|
final String location = user.getGeoLocation();
|
||||||
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) {
|
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) {
|
||||||
|
@ -56,8 +56,8 @@ public class Commandwhois extends EssentialsCommand {
|
|||||||
sender.sendMessage(tl("whoisAFK", tl("false")));
|
sender.sendMessage(tl("whoisAFK", tl("false")));
|
||||||
}
|
}
|
||||||
sender.sendMessage(tl("whoisJail", (user.isJailed() ? user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true") : tl("false"))));
|
sender.sendMessage(tl("whoisJail", (user.isJailed() ? user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true") : tl("false"))));
|
||||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
sender.sendMessage(tl("whoisMuted") + (user.hasMuteReason() ?
|
||||||
tl("muteReason", user.getMuteReason()) : ""));
|
(" " + tl("muteReason", user.getMuteReason())) : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user