package net.benjidial.nswp.commands; import net.benjidial.nswp.Database; import net.benjidial.nswp.Waypoint; import org.bukkit.entity.Player; import java.sql.SQLException; import java.util.List; public class DeleteWaypoint extends PlayerCommand { public List getTabCompletions(Player sender, String[] args) throws SQLException { return searchWaypointsByArg(sender, args, 0); } public boolean doCommand(Player sender, String[] args) throws SQLException { if (args.length != 1) return false; Database.createWaypointTable(sender); Waypoint wp = Database.lookupWaypoint(sender, args[0]); if (wp != null) { Database.deleteWaypoint(sender, args[0]); sender.sendMessage("Deleted " + wp.toString() + "."); } else sender.sendMessage("You do not have a waypoint " + args[0] + "."); return true; } }