Use correct location in teleporting messages

This commit is contained in:
Phoenix616 2019-04-13 12:17:50 +01:00
parent 5f73ccc955
commit 9a1004723c
1 changed files with 8 additions and 8 deletions

View File

@ -319,19 +319,19 @@ public class RandomTeleport extends JavaPlugin {
cooldowns.put(searcher.getId(), e.getUniqueId(), new AbstractMap.SimpleImmutableEntry<>(System.currentTimeMillis(), searcher.getCooldown()));
e.teleport(targetLoc);
sendMessage(e, "teleport",
"worldname", center.getWorld().getName(),
"x", String.valueOf(center.getBlockX()),
"y", String.valueOf(center.getBlockY()),
"z", String.valueOf(center.getBlockZ())
"worldname", targetLoc.getWorld().getName(),
"x", String.valueOf(targetLoc.getBlockX()),
"y", String.valueOf(targetLoc.getBlockY()),
"z", String.valueOf(targetLoc.getBlockZ())
);
if (searcher.getOptions().containsKey("spawnpoint") && e instanceof Player) {
if (((Player) e).getBedSpawnLocation() == null || "force".equalsIgnoreCase(searcher.getOptions().get("spawnpoint"))){
((Player) e).setBedSpawnLocation(targetLoc, true);
sendMessage(e, "setspawnpoint",
"worldname", center.getWorld().getName(),
"x", String.valueOf(center.getBlockX()),
"y", String.valueOf(center.getBlockY()),
"z", String.valueOf(center.getBlockZ())
"worldname", targetLoc.getWorld().getName(),
"x", String.valueOf(targetLoc.getBlockX()),
"y", String.valueOf(targetLoc.getBlockY()),
"z", String.valueOf(targetLoc.getBlockZ())
);
}
}