1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-09 16:17:37 +02:00

Slightly reorder teleport messages to be less confusing.

This commit is contained in:
KHobbits
2014-06-28 18:06:13 +01:00
parent 36f3540da9
commit e0893adb12
2 changed files with 6 additions and 6 deletions

View File

@@ -147,8 +147,8 @@ public class Teleport implements net.ess3.api.ITeleport
public void teleport(Player entity, Trade chargeFor, TeleportCause cause) throws Exception public void teleport(Player entity, Trade chargeFor, TeleportCause cause) throws Exception
{ {
ITarget target = new PlayerTarget(entity); ITarget target = new PlayerTarget(entity);
teleport(teleportOwner, target, chargeFor, cause);
teleportOwner.sendMessage(tl("teleportToPlayer", entity.getDisplayName())); teleportOwner.sendMessage(tl("teleportToPlayer", entity.getDisplayName()));
teleport(teleportOwner, target, chargeFor, cause);
} }
//This is used when teleporting to stored location //This is used when teleporting to stored location
@@ -177,7 +177,7 @@ public class Teleport implements net.ess3.api.ITeleport
if (chargeFor != null) if (chargeFor != null)
{ {
chargeFor.isAffordableFor(teleportOwner); chargeFor.isAffordableFor(teleportOwner);
//This code is to make sure that commandcosts are checked in the initial world, and not in the resulting world. //This code is to make sure that commandcosts are checked in the initial world, and not in the resulting world.
if (!chargeFor.getCommandCost(teleportOwner).equals(BigDecimal.ZERO)) if (!chargeFor.getCommandCost(teleportOwner).equals(BigDecimal.ZERO))
{ {

View File

@@ -58,8 +58,8 @@ public class Commandtp extends EssentialsCommand
{ {
throw new Exception(tl("teleportDisabled", target2.getDisplayName())); throw new Exception(tl("teleportDisabled", target2.getDisplayName()));
} }
target2.getTeleport().now(loc, false, TeleportCause.COMMAND);
user.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); user.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
target2.getTeleport().now(loc, false, TeleportCause.COMMAND);
target2.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); target2.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
break; break;
case 2: case 2:
@@ -83,8 +83,8 @@ public class Commandtp extends EssentialsCommand
{ {
throw new Exception(tl("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); throw new Exception(tl("noPerm", "essentials.worlds." + toPlayer.getWorld().getName()));
} }
target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND);
target.sendMessage(tl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); target.sendMessage(tl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND);
break; break;
} }
} }
@@ -101,8 +101,8 @@ public class Commandtp extends EssentialsCommand
if (args.length == 2) if (args.length == 2)
{ {
final User toPlayer = getPlayer(server, args, 1, true, false); final User toPlayer = getPlayer(server, args, 1, true, false);
target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND);
target.sendMessage(tl("teleportAtoB", Console.NAME, toPlayer.getDisplayName())); target.sendMessage(tl("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND);
} }
else if (args.length > 3) else if (args.length > 3)
{ {
@@ -114,9 +114,9 @@ public class Commandtp extends EssentialsCommand
throw new NotEnoughArgumentsException(tl("teleportInvalidLocation")); throw new NotEnoughArgumentsException(tl("teleportInvalidLocation"));
} }
final Location loc = new Location(target.getWorld(), x, y, z, target.getLocation().getYaw(), target.getLocation().getPitch()); final Location loc = new Location(target.getWorld(), x, y, z, target.getLocation().getYaw(), target.getLocation().getPitch());
sender.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
target.getTeleport().now(loc, false, TeleportCause.COMMAND); target.getTeleport().now(loc, false, TeleportCause.COMMAND);
target.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); target.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
sender.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
} }
else else
{ {