Merge branch 'master' into release

This commit is contained in:
KHobbits 2012-01-29 05:00:04 +00:00
commit 5a7f38fa29
7 changed files with 35 additions and 32 deletions

View File

@ -31,7 +31,7 @@ public class Commandkill extends EssentialsCommand
continue;
}
matchPlayer.setHealth(0);
matchPlayer.damage(1000);
sender.sendMessage(_("kill", matchPlayer.getDisplayName()));
}
}

View File

@ -26,29 +26,29 @@ public class Commandnear extends EssentialsCommand
{
try
{
otherUser = getPlayer(server, args, 0);
radius = Long.parseLong(args[0]);
}
catch (Exception ex)
catch (NumberFormatException e)
{
try
{
radius = Long.parseLong(args[0]);
otherUser = getPlayer(server, args, 0);
}
catch (Exception ex)
{
}
}
if (args.length > 1 && otherUser != null)
{
try
{
radius = Long.parseLong(args[1]);
}
catch (NumberFormatException e)
{
}
}
}
if (args.length > 1 && otherUser != null)
{
try
{
radius = Long.parseLong(args[1]);
}
catch (NumberFormatException e)
{
}
}
if (otherUser == null || user.isAuthorized("essentials.near.others"))
{
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
@ -62,16 +62,11 @@ public class Commandnear extends EssentialsCommand
@Override
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
User otherUser = null;
if (args.length > 0)
{
otherUser = getPlayer(server, args, 0);
}
else
if (args.length == 0)
{
throw new NotEnoughArgumentsException();
}
final User otherUser = getPlayer(server, args, 0);
long radius = 200;
if (args.length > 1)
{

View File

@ -53,7 +53,7 @@ public class Commandr extends EssentialsCommand
final CommandSender target = replyTo.getReplyTo();
final String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME;
if (target == null)
if (target == null || ((target instanceof Player) && ((Player)target).isOnline()))
{
throw new Exception(_("foreverAlone"));
}

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.event.entity.EntityDamageEvent;
public class Commandsuicide extends EssentialsCommand
@ -15,9 +16,10 @@ public class Commandsuicide extends EssentialsCommand
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
user.setHealth(0);
EntityDamageEvent ede = new EntityDamageEvent(user, EntityDamageEvent.DamageCause.SUICIDE, 1000);
server.getPluginManager().callEvent(ede);
user.damage(1000);
user.sendMessage(_("suicideMessage"));
ess.broadcastMessage(user,
_("suicideSuccess", user.getDisplayName()));
ess.broadcastMessage(user,_("suicideSuccess", user.getDisplayName()));
}
}

View File

@ -27,6 +27,11 @@ public class Commandtpaccept extends EssentialsCommand
throw new Exception(_("noPendingRequest"));
}
if (args.length > 0 && !target.getName().contains(args[0]))
{
throw new Exception(_("noPendingRequest"));
}
long timeout = ess.getSettings().getTpaAcceptCancellation();
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
{

View File

@ -157,6 +157,7 @@ player-commands:
- xmpp
# Note: All items MUST be followed by a quantity!
# All kit names should be lower case, and will be treated as lower in permissions/costs.
# Times are measured in seconds.
kits:
tools:

View File

@ -348,7 +348,7 @@ commands:
aliases: [etpaall]
tpaccept:
description: Accepts a teleport request.
usage: /<command>
usage: /<command> [otherplayer]
aliases: [tpyes,etpaccept,etpyes]
tpahere:
description: Request that the specified player teleport to you.