mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-29 22:23:59 +01:00
Pretty print location in /npc moveto
This commit is contained in:
parent
8779062a82
commit
a535cea8bc
@ -1088,7 +1088,7 @@ public class NPCCommands {
|
||||
|
||||
npc.teleport(to, TeleportCause.COMMAND);
|
||||
NMS.look(npc.getEntity(), to.getYaw(), to.getPitch());
|
||||
Messaging.sendTr(sender, Messages.MOVETO_TELEPORTED, npc.getName(), to);
|
||||
Messaging.sendTr(sender, Messages.MOVETO_TELEPORTED, npc.getName(), Util.prettyPrintLocation(to));
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
@ -217,6 +217,11 @@ public class Util {
|
||||
return e.name().toLowerCase().replace('_', ' ');
|
||||
}
|
||||
|
||||
public static String prettyPrintLocation(Location to) {
|
||||
return String.format("%s at %d, %d, %d (%d, %d)", to.getWorld().getName(), to.getBlockX(), to.getBlockY(),
|
||||
to.getBlockZ(), (int) to.getYaw(), (int) to.getPitch());
|
||||
}
|
||||
|
||||
public static String[] splitPlayerName(String coloredName) {
|
||||
String name = coloredName, prefix = null, suffix = null;
|
||||
if (coloredName.length() > 16) {
|
||||
|
Loading…
Reference in New Issue
Block a user