mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-13 12:38:58 +00:00
![ementalo](/assets/img/avatar_default.png)
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1399 e251c2fe-e539-e718-e476-b85c1f46cddb
33 lines
639 B
Java
33 lines
639 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import org.bukkit.Server;
|
|
import com.earth2me.essentials.User;
|
|
import com.earth2me.essentials.Util;
|
|
|
|
|
|
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(Util.format("depthAboveSea", y));
|
|
}
|
|
else if (y < 0)
|
|
{
|
|
user.sendMessage(Util.format("depthBelowSea", (-y)));
|
|
}
|
|
else
|
|
{
|
|
user.sendMessage(Util.i18n("depth"));
|
|
}
|
|
}
|
|
}
|