diff options
author | ementalo <suror@gmx.co.uk> | 2011-07-16 23:53:53 +0100 |
---|---|---|
committer | ementalo <suror@gmx.co.uk> | 2011-07-16 23:53:53 +0100 |
commit | 31326d530fd4db51b45769f38a31f1200f3e15ed (patch) | |
tree | d749dca2f3324a282ec781a932e071fc499ce066 | |
parent | b749cd4e42b029c34b077b5c2c997b746b994481 (diff) | |
download | Essentials-31326d530fd4db51b45769f38a31f1200f3e15ed.tar Essentials-31326d530fd4db51b45769f38a31f1200f3e15ed.tar.gz Essentials-31326d530fd4db51b45769f38a31f1200f3e15ed.tar.lz Essentials-31326d530fd4db51b45769f38a31f1200f3e15ed.tar.xz Essentials-31326d530fd4db51b45769f38a31f1200f3e15ed.zip |
essentials.mute.exempt prevents muting, send messages when a player is muted to the muted
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java | 1 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandmute.java | 19 | ||||
-rw-r--r-- | Essentials/src/messages.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_da.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_de.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_en.properties | 3 | ||||
-rw-r--r-- | Essentials/src/messages_fr.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_nl.properties | 4 |
8 files changed, 39 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index 64905a4bc..f727681f1 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -60,6 +60,7 @@ public class EssentialsPlayerListener extends PlayerListener if (user.isMuted()) { event.setCancelled(true); + user.sendMessage(Util.i18n("playeMuted")); LOGGER.info(Util.format("mutedUserSpeaks", user.getName())); } final Iterator<Player> it = event.getRecipients().iterator(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java index aca821aac..14bc41b3c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java @@ -21,7 +21,12 @@ public class Commandmute extends EssentialsCommand throw new NotEnoughArgumentsException(); } - User p = getPlayer(server, args, 0); + User p = getPlayer(server, args, 0, true); + if (p.isAuthorized("essentials.mute.exempt")) + { + sender.sendMessage(commandLabel); + return; + } long muteTimestamp = 0; if (args.length > 1) { @@ -30,13 +35,19 @@ public class Commandmute extends EssentialsCommand } p.setMuteTimeout(muteTimestamp); charge(sender); - - + boolean muted = p.toggleMuted(); sender.sendMessage( - p.toggleMuted() + muted ? (muteTimestamp > 0 ? Util.format("mutedPlayerFor", p.getDisplayName(), Util.formatDateDiff(muteTimestamp)) : Util.format("mutedPlayer", p.getDisplayName())) : Util.format("unmutedPlayer", p.getDisplayName())); + p.sendMessage( + muted + ? (muteTimestamp > 0 + ? Util.format("playerMutedFor", Util.formatDateDiff(muteTimestamp)) + : Util.i18n("playerMuted")) + : Util.i18n("playerUnmuted")); + } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index cd7607c24..6cd465575 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -182,6 +182,7 @@ nickSet = \u00a77Your nickname is now \u00a7c{0} noAccessCommand = \u00a7cYou do not have access to that command. noAccessPermission = \u00a7cYou do not have permission to access that {0}. noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}. +noHelpFound = \u00a7cNo matching commands. noHomeSet = You have not set a home. noHomeSetPlayer = Player has not set a home. noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit. @@ -213,8 +214,11 @@ playerInJail = \u00a7cPlayer is already in jail {0}. playerJailed = \u00a77Player {0} jailed. playerJailedFor = \u00a77Player {0} jailed for {1}. playerKicked = \u00a7cPlayer {0} kicked: {1} +playerMuted = "$7You have been muted" +playerMutedFor = "$7You have been muted for {0}" playerNeverOnServer = \u00a7cPlayer {0} was never on this server. playerNotFound = \u00a7cPlayer not found. +playerUnmuted = "$7You have been unmuted" pong = Pong! possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}. powerToolAir = Command can''t be attached to air. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index bd0352289..84b851a0c 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -184,6 +184,7 @@ nickSet = \u00a77Dit kaldenavn er nu \u00a7c{0} noAccessCommand = \u00a7cDu har ikke adgang til den kommando. noAccessPermission = \u00a7cDu har ikke tilladelse til at f\u00e5 adgang til det {0}. noDestroyPermission = \u00a7cDu har ikke tilladelse til at \u00f8del\u00e6gge det {0}. +noHelpFound = \u00a7cNo matching commands. noHomeSet = Du har sat et nyt hjem. noHomeSetPlayer = Spiller har ikke sat et hjem. noKitPermission = \u00a7cDu har brug for \u00a7c{0}\u00a7c tilladelsen for at bruge den pakke. @@ -215,8 +216,11 @@ playerInJail = \u00a7cSpiller er allerede i f\u00e6ngsel {0}. playerJailed = \u00a77Spiller {0} f\u00e6ngslet. playerJailedFor = \u00a77Spiller {0} f\u00e6ngslet for {1}. playerKicked = \u00a7cPlayer {0} kicked: {1} +playerMuted = "$7You have been muted" +playerMutedFor = "$7You have been muted for {0}" playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server. playerNotFound = \u00a7cSpiller ikke fundet. +playerUnmuted = "$7You have been unmuted" pong = Pong! possibleWorlds = \u00a77Mulige verdener er numrene 0 igennem {0}. powerToolAir = Kommando kan ikke blive tildelt luft. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index cfc7f41e4..e2a0e8401 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -182,6 +182,7 @@ nickSet = \u00a77Dein Nickname ist nun \u00a7c{0} noAccessCommand = \u00a7cDu hast keinen Zugriff auf diesen Befehl. noAccessPermission = \u00a7cDu hast keine Rechte, den Block {0} zu \u00f6ffnen. noDestroyPermission = \u00a7cDu hast keine Rechte, den Block {0} zu zerst\u00f6ren. +noHelpFound = \u00a7cNo matching commands. noHomeSet = Du hast kein Zuhause gesetzt. noHomeSetPlayer = Spieler hat kein Zuhause gesetzt. noKitPermission = \u00a7cDu brauchst die Berechtigung \u00a7c{0}\u00a7c um diese Ausr\u00fcstung anzufordern. @@ -213,8 +214,11 @@ playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}. playerJailed = \u00a77Spieler {0} eingesperrt. playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}. playerKicked = \u00a7cSpieler {0} rausgeworfen: {1} +playerMuted = "$7You have been muted" +playerMutedFor = "$7You have been muted for {0}" playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server. playerNotFound = \u00a7cSpieler nicht gefunden. +playerUnmuted = "$7You have been unmuted" pong = Pong! possibleWorlds = \u00a77M\u00f6gliche Welten sind nummeriet von 0 bis {0}. powerToolAir = Befehl kann nicht mit Luft verbunden werden. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index d65e6fd7f..d5c088eef 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -214,8 +214,11 @@ playerInJail = \u00a7cPlayer is already in jail {0}. playerJailed = \u00a77Player {0} jailed. playerJailedFor = \u00a77Player {0} jailed for {1}. playerKicked = \u00a7cPlayer {0} kicked: {1} +playerMuted = "$7You have been muted" +playerMutedFor = "$7You have been muted for {0}" playerNeverOnServer = \u00a7cPlayer {0} was never on this server. playerNotFound = \u00a7cPlayer not found. +playerUnmuted = "$7You have been unmuted" pong = Pong! possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}. powerToolAir = Command can''t be attached to air. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index e5591cb96..ed5890c2e 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -182,6 +182,7 @@ nickSet = \u00a77Votre pseudo est maintenant \u00a7c{0} noAccessCommand = \u00a7cVous n''avez pas acc\u00e8s \u00e0 cette commande. noAccessPermission = \u00a7cVous n''avez pas la permissions d''acc\u00e9der \u00e0 cette {0} noDestroyPermission = \u00a7cVous n''avez pas la permission de d\u00e9truire ce {0}. +noHelpFound = \u00a7cNo matching commands. noHomeSet = Vous n''avez pas d\u00e9fini de home. noHomeSetPlayer = Le joueur n''a pas d\u00e9fini son home. noKitPermission = \u00a7cVous avez besoin de la permission \u00a7c{0}\u00a7c pour utiliser ce kit. @@ -213,8 +214,11 @@ playerInJail = \u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}. playerJailed = \u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9. playerJailedFor = \u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}. playerKicked = \u00a7cPlayer {0} kicked: {1} +playerMuted = "$7You have been muted" +playerMutedFor = "$7You have been muted for {0}" playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur. playerNotFound = \u00a7cLe joueur est introuvable. +playerUnmuted = "$7You have been unmuted" pong = Pong! possibleWorlds = \u00a77Les mondes possibles sont les nombres 0 par {0}. powerToolAir = La commande ne peut pas \u00eatre attach\u00e9e \u00e0 l''air. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 5091b6d42..0658d5cbf 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -183,6 +183,7 @@ nickSet = \u00a77Je nickname is nu \u00a7c{0} noAccessCommand = \u00a7cJe hebt geen toegang tot die opdracht. noAccessPermission = \u00a7cJe hebt hier geen toegang voor {0}. noDestroyPermission = \u00a7cJe hebt geen toegang om dat te vernietigen {0}. +noHelpFound = \u00a7cNo matching commands. noHomeSet = Je hebt geen home gemaakt. noHomeSetPlayer = Speler heeft geen home. noKitPermission = \u00a7cJe hebt de \u00a7c{0}\u00a7c toestemming nodig om die kit te gebruiken. @@ -214,8 +215,11 @@ playerInJail = \u00a7cSpeler zit al in de gevangenis {0}. playerJailed = \u00a77Speler {0} is in de gevangenis gezet. playerJailedFor = \u00a77Speler {0} is in de gevangenis gezet voor {1}. playerKicked = \u00a7cPlayer {0} kicked: {1} +playerMuted = "$7You have been muted" +playerMutedFor = "$7You have been muted for {0}" playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest. playerNotFound = \u00a7cSpeler niet gevonden. +playerUnmuted = "$7You have been unmuted" pong = Pong! possibleWorlds = \u00a77Mogelijk zijn de werelden de nummer 0 tot en met {0}. powerToolAir = Command kan niet worden bevestigd aan de lucht. |