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();
|
config.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasMuteReason(){
|
||||||
|
return getMuteReason().equals("");
|
||||||
|
}
|
||||||
|
|
||||||
private long muteTimeout;
|
private long muteTimeout;
|
||||||
|
|
||||||
private long _getMuteTimeout() {
|
private long _getMuteTimeout() {
|
||||||
|
@ -51,12 +51,8 @@ public class Commandafk extends EssentialsCommand {
|
|||||||
private void toggleAfk(User sender, User user, String message) throws Exception {
|
private void toggleAfk(User sender, User user, String message) throws Exception {
|
||||||
if (message != null && sender != null) {
|
if (message != null && sender != null) {
|
||||||
if (sender.isMuted()) {
|
if (sender.isMuted()) {
|
||||||
if (sender.getMuteReason ().equals ("")) {
|
throw new Exception(tl("voiceSilenced") + (sender.hasMuteReason() ?
|
||||||
throw new Exception(tl("voiceSilenced"));
|
tl("muteReason", sender.getMuteReason()) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Exception(tl("voiceSilenced") + " " + 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"));
|
||||||
|
@ -48,12 +48,8 @@ public class Commandmail extends EssentialsCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
if (user.getMuteReason ().equals ("")) {
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
throw new Exception(tl("voiceSilenced"));
|
tl("muteReason", user.getMuteReason()) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
User u = getPlayer(server, args[1], true, true);
|
User u = getPlayer(server, args[1], true, true);
|
||||||
|
@ -24,12 +24,8 @@ public class Commandme extends EssentialsCommand {
|
|||||||
@Override
|
@Override
|
||||||
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()) {
|
||||||
if (user.getMuteReason ().equals ("")) {
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
throw new Exception(tl("voiceSilenced"));
|
tl("muteReason", user.getMuteReason()) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
|
@ -28,12 +28,8 @@ public class Commandr extends EssentialsCommand {
|
|||||||
User user = ess.getUser(sender.getPlayer());
|
User user = ess.getUser(sender.getPlayer());
|
||||||
|
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
if (user.getMuteReason ().equals ("")) {
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
throw new Exception(tl("voiceSilenced"));
|
tl("muteReason", user.getMuteReason()) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Exception(tl("voiceSilenced") + " " + tl("muteReason", user.getMuteReason ()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message = FormatUtil.formatMessage(user, "essentials.msg", message);
|
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"))));
|
sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) : tl("true"))));
|
||||||
}
|
}
|
||||||
if (user.isMuted()) {
|
if (user.isMuted()) {
|
||||||
if (user.getMuteReason ().equals ("")) {
|
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"))));
|
tl("muteReason", user.getMuteReason()) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true"))) + " " + 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,12 +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"))));
|
||||||
if (user.getMuteReason ().equals ("")) {
|
throw new Exception(tl("voiceSilenced") + (user.hasMuteReason() ?
|
||||||
sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false"))));
|
tl("muteReason", user.getMuteReason()) : ""));
|
||||||
}
|
|
||||||
else {
|
|
||||||
sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) : tl("true") : tl("false")) + " " + tl("muteReason", user.getMuteReason ())));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user