summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunfighterJ <joseph.jenniges@gmail.com>2013-01-17 17:36:27 -0600
committerGunfighterJ <joseph.jenniges@gmail.com>2013-01-17 17:42:32 -0600
commit78e6da95043c05e073045e626f217b34947a63e7 (patch)
tree79f9757d4f69f458d68808536146edbc29181079
parent0014d5cfcbc73b021dbfdc90a1a5451d0fe29ed6 (diff)
downloadEssentials-78e6da95043c05e073045e626f217b34947a63e7.tar
Essentials-78e6da95043c05e073045e626f217b34947a63e7.tar.gz
Essentials-78e6da95043c05e073045e626f217b34947a63e7.tar.lz
Essentials-78e6da95043c05e073045e626f217b34947a63e7.tar.xz
Essentials-78e6da95043c05e073045e626f217b34947a63e7.zip
Adds essentials.mute.notify
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmute.java41
-rw-r--r--Essentials/src/messages.properties1
-rw-r--r--Essentials/src/messages_cs.properties2
-rw-r--r--Essentials/src/messages_da.properties1
-rw-r--r--Essentials/src/messages_de.properties1
-rw-r--r--Essentials/src/messages_en.properties1
-rw-r--r--Essentials/src/messages_es.properties1
-rw-r--r--Essentials/src/messages_fi.properties1
-rw-r--r--Essentials/src/messages_fr.properties1
-rw-r--r--Essentials/src/messages_it.properties1
-rw-r--r--Essentials/src/messages_nl.properties1
-rw-r--r--Essentials/src/messages_pl.properties1
-rw-r--r--Essentials/src/messages_pt.properties1
-rw-r--r--Essentials/src/messages_se.properties1
14 files changed, 41 insertions, 14 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java
index fa86a8a02..f9e051c91 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java
@@ -5,6 +5,7 @@ import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
public class Commandmute extends EssentialsCommand
@@ -41,17 +42,31 @@ public class Commandmute extends EssentialsCommand
}
player.setMuteTimeout(muteTimestamp);
final boolean muted = player.getMuted();
- sender.sendMessage(
- muted
- ? (muteTimestamp > 0
- ? _("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp))
- : _("mutedPlayer", player.getDisplayName()))
- : _("unmutedPlayer", player.getDisplayName()));
- player.sendMessage(
- muted
- ? (muteTimestamp > 0
- ? _("playerMutedFor", Util.formatDateDiff(muteTimestamp))
- : _("playerMuted"))
- : _("playerUnmuted"));
+ if (muted)
+ {
+ if (muteTimestamp > 0)
+ {
+ sender.sendMessage(_("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp)));
+ player.sendMessage(_("playerMutedFor", Util.formatDateDiff(muteTimestamp)));
+ }
+ else
+ {
+ sender.sendMessage(_("mutedPlayer", player.getDisplayName()));
+ player.sendMessage(_("playerMuted"));
+ }
+ for (Player onlinePlayer : server.getOnlinePlayers())
+ {
+ final User user = ess.getUser(onlinePlayer);
+ if (onlinePlayer != sender && user.isAuthorized("essentials.mute.notify"))
+ {
+ onlinePlayer.sendMessage(_("muteNotify", sender.getName(), player.getName()));
+ }
+ }
+ }
+ else
+ {
+ sender.sendMessage(_("unmutedPlayer", player.getDisplayName()));
+ player.sendMessage(_("playerUnmuted"));
+ }
}
-}
+} \ No newline at end of file
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index ceca9beb4..c35e225f6 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties
index 5178598e8..a6c98d3bf 100644
--- a/Essentials/src/messages_cs.properties
+++ b/Essentials/src/messages_cs.properties
@@ -492,4 +492,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
-
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 106bea42a..c9d4870a9 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 6f02ec613..a113e164a 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index ceca9beb4..c35e225f6 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties
index 25ae737ed..2349c824e 100644
--- a/Essentials/src/messages_es.properties
+++ b/Essentials/src/messages_es.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties
index 6a18d49a1..4f1e3b785 100644
--- a/Essentials/src/messages_fi.properties
+++ b/Essentials/src/messages_fi.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 40deed6bd..8e0a9a9be 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties
index addc32c3e..cc7fcf49b 100644
--- a/Essentials/src/messages_it.properties
+++ b/Essentials/src/messages_it.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index de37ddd68..360d76db1 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties
index de9388897..a43b5f81f 100644
--- a/Essentials/src/messages_pl.properties
+++ b/Essentials/src/messages_pl.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties
index 028ea280f..d4e935d08 100644
--- a/Essentials/src/messages_pt.properties
+++ b/Essentials/src/messages_pt.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties
index d47289567..3083a5b60 100644
--- a/Essentials/src/messages_se.properties
+++ b/Essentials/src/messages_se.properties
@@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
fireworkColor=\u00a74You must apply a color to the firework to add an effect
holdFirework=\u00a74You must be holding a firework to add effects
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
+muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}