mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-10 21:11:07 +01:00
Merge branch 'mutes385' of https://github.com/delbertina/Essentials into mutes385
Updated local copy Conflicts: Essentials/src/com/earth2me/essentials/commands/Commandafk.java Essentials/src/com/earth2me/essentials/commands/Commandmail.java Essentials/src/com/earth2me/essentials/commands/Commandme.java Essentials/src/com/earth2me/essentials/commands/Commandr.java Essentials/src/com/earth2me/essentials/commands/Commandseen.java Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
This commit is contained in:
commit
127a7bb2ce
@ -536,6 +536,10 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||
config.save();
|
||||
}
|
||||
|
||||
public boolean hasMuteReason(){
|
||||
return getMuteReason().equals("");
|
||||
}
|
||||
|
||||
private long muteTimeout;
|
||||
|
||||
private long _getMuteTimeout() {
|
||||
|
@ -51,12 +51,8 @@ public class Commandafk extends EssentialsCommand {
|
||||
private void toggleAfk(User sender, User user, String message) throws Exception {
|
||||
if (message != null && sender != null) {
|
||||
if (sender.isMuted()) {
|
||||
if (sender.getMuteReason ().equals ("")) {
|
||||
throw new Exception(tl("voiceSilenced"));
|
||||
}
|
||||
else {
|
||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", sender.getMuteReason ()));
|
||||
}
|
||||
throw new Exception(tl("voiceSilenced") + (sender.hasMuteReason() ?
|
||||
tl("muteReason", sender.getMuteReason()) : ""));
|
||||
}
|
||||
if (!sender.isAuthorized("essentials.afk.message")) {
|
||||
throw new Exception(tl("noPermToAFKMessage"));
|
||||
|
@ -48,12 +48,8 @@ public class Commandmail extends EssentialsCommand {
|
||||
}
|
||||
|
||||
if (user.isMuted()) {
|
||||
if (user.getMuteReason ().equals ("")) {
|
||||
throw new Exception(tl("voiceSilenced"));
|
||||
}
|
||||
else {
|
||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
||||
}
|
||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||
tl("muteReason", user.getMuteReason()) : ""));
|
||||
}
|
||||
|
||||
User u = getPlayer(server, args[1], true, true);
|
||||
|
@ -24,12 +24,8 @@ public class Commandme extends EssentialsCommand {
|
||||
@Override
|
||||
public void run(Server server, User user, String commandLabel, String[] args) throws Exception {
|
||||
if (user.isMuted()) {
|
||||
if (user.getMuteReason ().equals ("")) {
|
||||
throw new Exception(tl("voiceSilenced"));
|
||||
}
|
||||
else {
|
||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
||||
}
|
||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||
tl("muteReason", user.getMuteReason()) : ""));
|
||||
}
|
||||
|
||||
if (args.length < 1) {
|
||||
|
@ -28,12 +28,8 @@ public class Commandr extends EssentialsCommand {
|
||||
User user = ess.getUser(sender.getPlayer());
|
||||
|
||||
if (user.isMuted()) {
|
||||
if (user.getMuteReason ().equals ("")) {
|
||||
throw new Exception(tl("voiceSilenced"));
|
||||
}
|
||||
else {
|
||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
||||
}
|
||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||
tl("muteReason", user.getMuteReason()) : ""));
|
||||
}
|
||||
|
||||
message = FormatUtil.formatMessage(user, "essentials.msg", message);
|
||||
|
@ -117,12 +117,8 @@ public class Commandseen extends EssentialsCommand {
|
||||
sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true"))));
|
||||
}
|
||||
if (user.isMuted()) {
|
||||
if (user.getMuteReason ().equals ("")) {
|
||||
sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + " " + tl("muteReason", user.getMuteReason ()));
|
||||
}
|
||||
throw new Exception(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + (user.hasMuteReason() ?
|
||||
tl("muteReason", user.getMuteReason()) : ""));
|
||||
}
|
||||
final String location = user.getGeoLocation();
|
||||
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) {
|
||||
|
@ -56,12 +56,8 @@ public class Commandwhois extends EssentialsCommand {
|
||||
sender.sendMessage(tl("whoisAFK", tl("false")));
|
||||
}
|
||||
sender.sendMessage(tl("whoisJail", (user.isJailed() ? user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true") : tl("false"))));
|
||||
if (user.getMuteReason ().equals ("")) {
|
||||
sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false"))));
|
||||
}
|
||||
else {
|
||||
sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")) + " " + tl("muteReason", user.getMuteReason ())));
|
||||
}
|
||||
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||
tl("muteReason", user.getMuteReason()) : ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user