mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-15 13:36:31 +00:00
![snowleo](/assets/img/avatar_default.png)
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1021 e251c2fe-e539-e718-e476-b85c1f46cddb
26 lines
757 B
Java
26 lines
757 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.Server;
|
|
import com.earth2me.essentials.Essentials;
|
|
import com.earth2me.essentials.User;
|
|
|
|
|
|
public class Commandtop extends EssentialsCommand
|
|
{
|
|
public Commandtop()
|
|
{
|
|
super("top");
|
|
}
|
|
|
|
@Override
|
|
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
|
|
{
|
|
int topX = user.getLocation().getBlockX();
|
|
int topZ = user.getLocation().getBlockZ();
|
|
int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
|
|
user.charge(this);
|
|
user.teleportTo(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), this.getName());
|
|
user.sendMessage("§7Teleporting to top.");
|
|
}
|
|
}
|