diff options
author | Benji Dial <benji6283@gmail.com> | 2022-11-12 13:39:07 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2022-11-12 13:39:07 -0500 |
commit | da7924881ab14e4580ae6c56dbdf8346dbf2a267 (patch) | |
tree | 3631cbb3a0eaa6c57c6b8476d130472561dc16c6 /src/main/java/net/benjidial/nswp/commands/SaveWaypoint.java | |
download | new-simple-waypoints-da7924881ab14e4580ae6c56dbdf8346dbf2a267.tar.gz |
first commit for new version
Diffstat (limited to 'src/main/java/net/benjidial/nswp/commands/SaveWaypoint.java')
-rw-r--r-- | src/main/java/net/benjidial/nswp/commands/SaveWaypoint.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/net/benjidial/nswp/commands/SaveWaypoint.java b/src/main/java/net/benjidial/nswp/commands/SaveWaypoint.java new file mode 100644 index 0000000..f0b9dcd --- /dev/null +++ b/src/main/java/net/benjidial/nswp/commands/SaveWaypoint.java @@ -0,0 +1,22 @@ +package net.benjidial.nswp.commands; + +import net.benjidial.nswp.Database; +import net.benjidial.nswp.Waypoint; + +import org.bukkit.entity.Player; + +import java.sql.SQLException; + +public class SaveWaypoint extends WaypointCommand { + public CompletionType getCompletionType() { + return CompletionType.None; + } + + public boolean body(Player player, String[] args) throws SQLException { + if (args.length != 1) + return false; + Waypoint waypoint = new Waypoint(args[0], player.getLocation()); + Database.addWaypoint(player, waypoint); + return true; + } +} |