Here is a Plugin i made some years back on Bukkit:
<code=java>
package me.TheShermanTanker.SurfaceCommand;
import java.util.Random
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.plugin.java.JavaPlugin;
public class SurfaceCommand extends JavaPlugin{
public void onEnable(){
getLogger().info(ChatColor.GREEN + “Spigot 1.7 Surface Command Plugin is the first Plugin by TheShermanTanker”);
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
}
if (cmd.getName().equalsIgnoreCase(“surface”) && sender instanceof Player)
Player player = (Player) sender
Location
original.Location = player.getLocation();
Random random = new Random();
Location
teleportLocation = null;
boolean isOnLand = false;
while (isOnLand == false) {
teleportLocation = new Location(world.getHighestBlockAt());
if (teleportLocation.getBlock().getType()!=Material.AIR){
isOnLand = true;
} else y--;
}
player.teleport(teleportLocation);
player.sendMessage(ChatColor.GREEN + "Teleported to the surface!");
return true;
}
User types /surface and is teleported to the surface. How do i convert this into sponge code?
