Adding tempban/kick broadcast permissions and adding a banned by to the broadcast.

Adding tempban/kick broadcast permissions and adding a banned by to the broadcast.
Merge branch 'master' of github.com:khobbits/Essentials

Conflicts:
	Essentials/src/messages.properties
	Essentials/src/messages_da.properties
	Essentials/src/messages_en.properties
	Essentials/src/messages_fr.properties
	Essentials/src/messages_nl.properties
Merge branch 'master' of github.com:khobbits/Essentials
This commit is contained in:
KHobbits 2011-07-26 14:23:14 +01:00
parent 8bb4067f06
commit 0ab8a2760d
9 changed files with 43 additions and 19 deletions

View file

@ -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));
}
}
}
}