mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 03:24:58 +00:00
Add offline tp command
This commit is contained in:
parent
bcb179a2a1
commit
8dcf315305
1 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
|||
package me.StevenLawson.TotalFreedomMod.commands;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import me.StevenLawson.TotalFreedomMod.bridge.EssentialsBridge;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -34,7 +37,12 @@ public class Command_offlinetp extends FreedomCommand {
|
|||
}
|
||||
|
||||
playerMsg(sender, String.format("Teleporting to %s's last known location...", target.getName()));
|
||||
sender_p.teleport(target.getPlayer().getLocation());
|
||||
try {
|
||||
Location location = EssentialsBridge.getEssentialsUser(target.getName()).getLastLocation();
|
||||
sender_p.teleport(location);
|
||||
} catch (Exception e) {
|
||||
playerMsg(sender, "Oops");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue