diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-07-27 06:28:57 -0700 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-07-27 06:28:57 -0700 |
commit | acb50786c480af37c774b6a57830721c19c5e2bd (patch) | |
tree | 6ce5226eaa71329322f3102e6c15e4f39e52ae54 /Essentials | |
parent | beb34a7651d24d973b9ae1c99294cd10cf5bd94a (diff) | |
parent | 33f48eae0dbf91afd6415606fd5f3a6bbcc38089 (diff) | |
download | Essentials-acb50786c480af37c774b6a57830721c19c5e2bd.tar Essentials-acb50786c480af37c774b6a57830721c19c5e2bd.tar.gz Essentials-acb50786c480af37c774b6a57830721c19c5e2bd.tar.lz Essentials-acb50786c480af37c774b6a57830721c19c5e2bd.tar.xz Essentials-acb50786c480af37c774b6a57830721c19c5e2bd.zip |
Merge pull request #20 from khobbits/master
Ban changes
Diffstat (limited to 'Essentials')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandban.java | 5 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandhelp.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkick.java | 19 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandtempban.java | 12 | ||||
-rw-r--r-- | Essentials/src/config.yml | 3 | ||||
-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 | 4 | ||||
-rw-r--r-- | Essentials/src/messages_fr.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_nl.properties | 4 |
11 files changed, 49 insertions, 18 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 45e6a2035..628058c6e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import com.earth2me.essentials.OfflinePlayer; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -53,12 +54,14 @@ public class Commandban extends EssentialsCommand } player.kickPlayer(banReason); ess.getBans().banByName(player.getName()); + String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + for(Player p : server.getOnlinePlayers()) { User u = ess.getUser(p); if(u.isAuthorized("essentials.ban.notify")) { - p.sendMessage(Util.format("playerBanned", player.getName(), banReason)); + p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason)); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java index 07945b75b..2b1ba9776 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java @@ -153,6 +153,10 @@ public class Commandhelp extends EssentialsCommand retval.add("§c" + k.getKey() + "§7: " + value.get("description")); } } + else if (user.isAuthorized("essentials.help." + pluginName)) + { + retval.add("§c" + k.getKey() + "§7: " + value.get("description")); + } else { if (!ess.getSettings().hidePermissionlessHelp()) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java index 6bae4e713..e9b3720fe 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -1,9 +1,11 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import org.bukkit.Server; import org.bukkit.command.CommandSender; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; +import org.bukkit.entity.Player; public class Commandkick extends EssentialsCommand @@ -21,15 +23,24 @@ public class Commandkick extends EssentialsCommand throw new NotEnoughArgumentsException(); } - User u = getPlayer(server, args, 0); - if (u.isAuthorized("essentials.kick.exempt")) + User player = getPlayer(server, args, 0); + if (player.isAuthorized("essentials.kick.exempt")) { sender.sendMessage(Util.i18n("kickExempt")); return; } charge(sender); final String kickReason = args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault"); - u.kickPlayer(kickReason); - server.broadcastMessage(Util.format("playerKicked", u.getName(), kickReason)); + player.kickPlayer(kickReason); + String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + + for(Player p : server.getOnlinePlayers()) + { + User u = ess.getUser(p); + if(u.isAuthorized("essentials.kick.notify")) + { + p.sendMessage(Util.format("playerKicked", senderName, player.getName(), kickReason)); + } + } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index c9495401e..a20ad067f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import com.earth2me.essentials.OfflinePlayer; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -48,6 +49,15 @@ public class Commandtempban extends EssentialsCommand player.setBanTimeout(banTimestamp); player.kickPlayer(banReason); ess.getBans().banByName(player.getName()); - server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason)); + String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + + for(Player p : server.getOnlinePlayers()) + { + User u = ess.getUser(p); + if(u.isAuthorized("essentials.ban.notify")) + { + p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason)); + } + } } } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 186d4a1f0..4cf45b916 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -284,6 +284,9 @@ economy-log-enabled: false non-ess-in-help: true #Hide plugins which dont give a permission +#You can override a true value here for a single plugin by adding a permission to a user/group. +#The indervidual permission is: essentials.help.<plugin>, anyone with essentials.* or '*' will see all help this setting reguardless. +#You can use negitive permissions to remove access to just a single plugins help if the following is enabled. hide-permissionless-help: true ############################################################ diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 3691f2a83..e99f1eba2 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Error parsing {0} on line {1} pendingTeleportCancelled = \u00a7cPending teleportation request cancelled. permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. -playerBanned = \u00a7cPlayer {0} banned: {1} +playerBanned = \u00a7cPlayer {0} banned {1} for {2} playerInJail = \u00a7cPlayer is already in jail {0}. playerJailed = \u00a77Player {0} jailed. playerJailedFor = \u00a77Player {0} jailed for {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked {1} for: {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cPlayer {0} was never on this server. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 13f68b5db..d4ff0c3cf 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -213,11 +213,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Fejl ved parsing {0} p\u00e5 linje {1} pendingTeleportCancelled = \u00a7cVentende teleportations anmodning aflyst. permissionsError = Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re sl\u00e5et fra. -playerBanned = \u00a7cSpiller {0} bannet: {1} +playerBanned = \u00a7cSpiller {0} bannet {1} - {2} 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} +playerKicked = \u00a7cPlayer {0} kicked {1} for: {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index be24d9ac0..61fa2f6a9 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather unterst\u00fctzt nur sun/storm. parseError = Fehler beim Parsen von {0} in Zeile {1} pendingTeleportCancelled = \u00a7cLaufende Teleportierung abgebrochen. permissionsError = Permissions/GroupManager fehlt; Chat-Prefixe/-Suffixe sind ausgeschaltet. -playerBanned = \u00a7cSpieler {0} gesperrt: {1} +playerBanned = \u00a7cSpieler {0} gesperrt: {1} - {2} playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}. playerJailed = \u00a77Spieler {0} eingesperrt. playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}. -playerKicked = \u00a7cSpieler {0} rausgeworfen: {1} +playerKicked = \u00a7cSpieler {0} rausgeworfen: {1} - {2} playerMuted = \u00a77Du bist jetzt stumm. playerMutedFor = \u00a77Du bist jetzt stumm f\u00fcr {0}. playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 38b84bb93..e1416122d 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Error parsing {0} on line {1} pendingTeleportCancelled = \u00a7cPending teleportation request cancelled. permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. -playerBanned = \u00a7cPlayer {0} banned: {1} +playerBanned = \u00a7cPlayer {0} banned {1} for: {2} playerInJail = \u00a7cPlayer is already in jail {0}. playerJailed = \u00a77Player {0} jailed. playerJailedFor = \u00a77Player {0} jailed for {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked {1} for: {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cPlayer {0} was never on this server. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index e240b43af..3a3a2e6cc 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Erreur de conversion {0} \u00e0 la ligne {1} pendingTeleportCancelled = \u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e. permissionsError = Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s. -playerBanned = \u00a7cLe joueur {0} a \u00e9t\u00e9 banni: {1} +playerBanned = \u00a7cLe joueur {0} a \u00e9t\u00e9 banni: {1} - {2} 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} +playerKicked = \u00a7cPlayer {0} kicked {1} for {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 1f3915f7f..9387626dd 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -212,11 +212,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Fout bij ontleding {0} op regel {1} pendingTeleportCancelled = \u00a7cAangevraagde teleportatie afgelast. permissionsError = Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld. -playerBanned = \u00a7cSpeler {0} is geband: {1} +playerBanned = \u00a7cSpeler {0} is geband: {1} - {2} 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} +playerKicked = \u00a7cPlayer {0} kicked: {1} - {2} playerMuted = \u00a77Je kreeg het zwijgen opgelegd. playerMutedFor = \u00a77Je kreeg het zwijgen opgelegd voor {0} playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest. |