|
@@ -58,6 +58,7 @@ public class vMinecraftCommands{
|
|
cl.register("/freeze", "freeze");
|
|
cl.register("/freeze", "freeze");
|
|
cl.register("/tp", "teleport");
|
|
cl.register("/tp", "teleport");
|
|
cl.register("/tphere", "tphere");
|
|
cl.register("/tphere", "tphere");
|
|
|
|
+ cl.register("/tpback", "tpback");
|
|
cl.register("/masstp", "masstp", "Teleports those with lower permissions to you");
|
|
cl.register("/masstp", "masstp", "Teleports those with lower permissions to you");
|
|
|
|
|
|
//Health
|
|
//Health
|
|
@@ -177,6 +178,17 @@ public class vMinecraftCommands{
|
|
.globalmessages());
|
|
.globalmessages());
|
|
return EXIT_SUCCESS;
|
|
return EXIT_SUCCESS;
|
|
}
|
|
}
|
|
|
|
+ public static int tpback(Player player, String[] args){
|
|
|
|
+ if(player.canUseCommand("/tpback")){
|
|
|
|
+ double x = vMinecraftUsers.getProfile(player).getTpx();
|
|
|
|
+ double y = vMinecraftUsers.getProfile(player).getTpy();
|
|
|
|
+ double z = vMinecraftUsers.getProfile(player).getTpz();
|
|
|
|
+ player.teleportTo(x, y, z, 0, 0);
|
|
|
|
+ return EXIT_SUCCESS;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return EXIT_SUCCESS;
|
|
|
|
+ }
|
|
//=====================================================================
|
|
//=====================================================================
|
|
//Function: prefix (/prefix)
|
|
//Function: prefix (/prefix)
|
|
//Input: Player player: The player using the command
|
|
//Input: Player player: The player using the command
|
|
@@ -1013,6 +1025,14 @@ public class vMinecraftCommands{
|
|
|
|
|
|
//If the player exists transport the user to the player
|
|
//If the player exists transport the user to the player
|
|
else {
|
|
else {
|
|
|
|
+ //Storing their previous location for tpback
|
|
|
|
+ double x = player.getLocation().x;
|
|
|
|
+ double y = player.getLocation().y;
|
|
|
|
+ double z = player.getLocation().z;
|
|
|
|
+ vMinecraftUsers.getProfile(player).setTpback(x, y, z);
|
|
|
|
+ if(player.canUseCommand("/tpback")){
|
|
|
|
+ player.sendMessage(Colors.DarkPurple + "Your previous location has been stored, use /tpback to return.");
|
|
|
|
+ }
|
|
vMinecraftChat.gmsg( player, vMinecraftChat.getName(player)
|
|
vMinecraftChat.gmsg( player, vMinecraftChat.getName(player)
|
|
+ Colors.LightBlue + " has teleported to "
|
|
+ Colors.LightBlue + " has teleported to "
|
|
+ vMinecraftChat.getName(playerTarget));
|
|
+ vMinecraftChat.getName(playerTarget));
|
|
@@ -1094,6 +1114,14 @@ public class vMinecraftCommands{
|
|
log.log(Level.INFO, player.getName() + " teleported "
|
|
log.log(Level.INFO, player.getName() + " teleported "
|
|
+ player.getName() + " to their self.");
|
|
+ player.getName() + " to their self.");
|
|
playerTarget.teleportTo(player);
|
|
playerTarget.teleportTo(player);
|
|
|
|
+ double x = player.getLocation().x;
|
|
|
|
+ double y = player.getLocation().y;
|
|
|
|
+ double z = player.getLocation().z;
|
|
|
|
+ vMinecraftUsers.getProfile(playerTarget).setTpback(x, y, z);
|
|
|
|
+ if(playerTarget.canUseCommand("/tpback"))
|
|
|
|
+ {
|
|
|
|
+ playerTarget.sendMessage(Colors.DarkPurple + "Your previous location has been stored, use /tpback to return.");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return EXIT_SUCCESS;
|
|
return EXIT_SUCCESS;
|
|
}
|
|
}
|