mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-18 22:49:45 +00:00

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1399 e251c2fe-e539-e718-e476-b85c1f46cddb
32 lines
759 B
Java
32 lines
759 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import org.bukkit.Server;
|
|
import com.earth2me.essentials.User;
|
|
import com.earth2me.essentials.Util;
|
|
|
|
|
|
public class Commandcompass extends EssentialsCommand
|
|
{
|
|
public Commandcompass()
|
|
{
|
|
super("compass");
|
|
}
|
|
|
|
@Override
|
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
|
{
|
|
charge(user);
|
|
int r = (int)user.getCorrectedYaw();
|
|
String dir;
|
|
if (r < 23) dir = "N";
|
|
else if (r < 68) dir = "NE";
|
|
else if (r < 113) dir = "E";
|
|
else if (r < 158) dir = "SE";
|
|
else if (r < 203) dir = "S";
|
|
else if (r < 248) dir = "SW";
|
|
else if (r < 293) dir = "W";
|
|
else if (r < 338) dir = "NW";
|
|
else dir = "N";
|
|
user.sendMessage(Util.format("compassBearing", dir, r));
|
|
}
|
|
}
|