Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.h31ix.nas.commands.basics;
- /*
- * NAS for Bukkit
- *
- * @author H31IX
- *
- * H31IX.NET
- * WWW.NITRATEGAMING.COM
- */
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import net.h31ix.nas.Nas;
- public class CommandHome implements CommandExecutor {
- private final Nas plugin;
- public CommandHome(Nas plugin){
- this.plugin = plugin;
- }
- public boolean onCommand(CommandSender cs, Command cmd, String alias, String[] args) {
- Player player = (Player)cs;
- if (cmd.getName().equalsIgnoreCase("home"))
- {
- if (plugin.checkHome(player) == true)
- {
- if (player.getWorld().getName().equalsIgnoreCase("world_pvp") || player.getWorld().getName().equalsIgnoreCase("world_pvp_nether"))
- {
- if (!player.hasPermission("nas.tpdelay"))
- {
- plugin.scheduleTeleportDelay(player, plugin.getHome(player));
- }
- else
- {
- player.teleport(plugin.getHome(player));
- }
- }
- else
- {
- player.teleport(plugin.getHome(player));
- }
- }
- else
- {
- player.sendMessage("You dont have a home set!");
- }
- }
- else if (cmd.getName().equalsIgnoreCase("sethome"))
- {
- double x = player.getLocation().getX();
- double y = player.getLocation().getY();
- double z = player.getLocation().getZ();
- plugin.setHome(x, y, z, player);
- player.sendMessage("Home set!");
- }
- System.gc();
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment