TF-EssentialsX/Essentials/src/com/earth2me/essentials/commands/Commandme.java
snowleo fb211d722c Prevent that hidden players broadcast afk messages
Prevent that moving players triggers unafk too early, they can now move within a radius of 3 blocks from the position where they went afk.
2011-09-02 16:16:15 +02:00

39 lines
802 B
Java

package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
public class Commandme extends EssentialsCommand
{
public Commandme()
{
super("me");
}
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
if (user.isMuted())
{
throw new Exception(Util.i18n("voiceSilenced"));
}
if (args.length < 1)
{
throw new NotEnoughArgumentsException();
}
final StringBuilder message = new StringBuilder();
message.append("* ");
message.append(user.getDisplayName());
message.append(' ');
for (int i = 0; i < args.length; i++)
{
message.append(args[i]);
message.append(' ');
}
ess.broadcastMessage(user, message.toString());
}
}