TF-EssentialsX/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java

33 lines
644 B
Java
Raw Normal View History

package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
public class Commanddepth extends EssentialsCommand
{
public Commanddepth()
{
super("depth");
}
@Override
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
charge(user);
int y = user.getLocation().getBlockY() - 63;
if (y > 0)
{
user.sendMessage("§7You are " + y + " block(s) above sea level.");
}
else if (y < 0)
{
user.sendMessage("§7You are " + (-y) + " block(s) below sea level.");
}
else
{
user.sendMessage("§7You are at sea level.");
}
}
}