diff --git a/pom.xml b/pom.xml
index da9b97c..030454d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
me.SuperRonanCraft
BetterRTP
jar
- 3.1.0-3
+ 3.1.0-4
1.8
diff --git a/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdLocation.java b/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdLocation.java
index 7be8b09..46a4bd4 100644
--- a/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdLocation.java
+++ b/src/main/java/me/SuperRonanCraft/BetterRTP/player/commands/types/CmdLocation.java
@@ -23,7 +23,7 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
return "location";
}
- //rtp location
+ //rtp location [player]
public void execute(CommandSender sendi, String label, String[] args) {
if (args.length == 2) {
if (sendi instanceof Player) {
@@ -38,6 +38,21 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
usage(sendi, label);
} else
sendi.sendMessage("Console is not able to execute this command! Try '/rtp help'");
+ } else if (args.length == 3 && BetterRTP.getInstance().getPerms().getRtpOther(sendi)) {
+ Player p = Bukkit.getPlayer(args[2]);
+ if (p != null && p.isOnline()) {
+ for (String location_name : getLocations().keySet()) {
+ if (location_name.equalsIgnoreCase(args[1].toLowerCase())) {
+ BetterRTP.getInstance().getCmd().tp(p, sendi, null, null, RTP_TYPE.COMMAND,
+ false, false, (WorldLocations) getLocations().get(location_name));
+ return;
+ }
+ }
+ usage(sendi, label);
+ } else if (p != null)
+ getCmd().playerNotOnline(sendi, args[1]);
+ else
+ usage(sendi, label);
} else
usage(sendi, label);
}
@@ -48,6 +63,10 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
for (String location_name : getLocations().keySet())
if (location_name.toLowerCase().startsWith(args[1].toLowerCase()))
list.add(location_name);
+ } else if (args.length == 3 && BetterRTP.getInstance().getPerms().getRtpOther(sendi)) {
+ for (Player p : Bukkit.getOnlinePlayers())
+ if (p.getName().toLowerCase().startsWith(args[2].toLowerCase()))
+ list.add(p.getName());
}
return list;
}
@@ -64,6 +83,10 @@ public class CmdLocation implements RTPCommand, RTPCommandHelpable {
return BetterRTP.getInstance().getRTP().worldLocations;
}
+ private Commands getCmd() {
+ return BetterRTP.getInstance().getCmd();
+ }
+
@Override
public String getHelp() {
return BetterRTP.getInstance().getText().getHelpLocation();
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 1d34b95..58ead18 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,5 +1,5 @@
main: me.SuperRonanCraft.BetterRTP.BetterRTP
-version: '3.1.0-3'
+version: '3.1.0-4'
name: BetterRTP
author: SuperRonanCraft
softdepend: