2011-07-15 22:22:22 +02:00
|
|
|
package com.onarandombox.MultiverseCore.commands;
|
2011-05-02 04:51:02 +02:00
|
|
|
|
2011-07-10 02:13:56 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2011-05-02 04:51:02 +02:00
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
2011-07-17 21:06:21 +02:00
|
|
|
import org.bukkit.permissions.PermissionDefault;
|
2011-05-02 04:51:02 +02:00
|
|
|
|
|
|
|
import com.onarandombox.MultiverseCore.MultiverseCore;
|
|
|
|
import com.onarandombox.utils.LocationManipulation;
|
|
|
|
|
2011-07-17 17:12:12 +02:00
|
|
|
public class CoordCommand extends MultiverseCommand {
|
2011-05-02 04:51:02 +02:00
|
|
|
|
|
|
|
private LocationManipulation locMan = new LocationManipulation();
|
|
|
|
|
|
|
|
public CoordCommand(MultiverseCore plugin) {
|
|
|
|
super(plugin);
|
2011-07-17 21:06:21 +02:00
|
|
|
this.setName("Coordinates");
|
|
|
|
this.setCommandUsage("/mvcoord");
|
|
|
|
this.setArgRange(0, 0);
|
|
|
|
this.addKey("mv coord");
|
|
|
|
this.addKey("mvcoord");
|
2011-07-18 01:13:33 +02:00
|
|
|
this.setPermission("multiverse.core.coord", "Returns detailed information on the Players where abouts.", PermissionDefault.OP);
|
2011-05-02 04:51:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-07-10 02:13:56 +02:00
|
|
|
public void runCommand(CommandSender sender, List<String> args) {
|
2011-05-02 04:51:02 +02:00
|
|
|
// Check if the command was sent from a Player.
|
|
|
|
if (sender instanceof Player) {
|
2011-07-09 16:33:18 +02:00
|
|
|
Player p = (Player) sender;
|
2011-05-02 04:51:02 +02:00
|
|
|
p.sendMessage(ChatColor.RED + "World: " + ChatColor.WHITE + p.getWorld().getName());
|
2011-07-17 17:12:12 +02:00
|
|
|
p.sendMessage(ChatColor.RED + "World Scale: " + ChatColor.WHITE + this.plugin.getMVWorld(p.getWorld().getName()).getScaling());
|
2011-06-25 23:43:46 +02:00
|
|
|
p.sendMessage(ChatColor.RED + "Coordinates: " + ChatColor.WHITE + this.locMan.strCoords(p.getLocation()));
|
|
|
|
p.sendMessage(ChatColor.RED + "Direction: " + ChatColor.WHITE + this.locMan.getDirection(p.getLocation()));
|
2011-05-02 04:51:02 +02:00
|
|
|
p.sendMessage(ChatColor.RED + "Block: " + ChatColor.WHITE + Material.getMaterial(p.getWorld().getBlockTypeIdAt(p.getLocation())));
|
|
|
|
} else {
|
|
|
|
sender.sendMessage("This command needs to be used from a Player.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|