Skip to content

Commit

Permalink
Add setUserLastPosition to API (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioDP authored Apr 25, 2023
1 parent fdb717a commit 3828581
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ public final CompletableFuture<Optional<SavedUser>> getUserData(@NotNull String
public CompletableFuture<Optional<Position>> getUserLastPosition(@NotNull User user) {
return plugin.supplyAsync(() -> plugin.getDatabase().getLastPosition(user));
}

/**
* Set the last {@link Position}, as used in the {@code /back} command, for this user
*
* @param user The {@link User} to set the last position for
* @param position The {@link Position} to set as the user's last position
* @since 4.2
*/
public void setUserLastPosition(@NotNull User user, @NotNull Position position) {
plugin.runAsync(() -> plugin.getDatabase().setLastPosition(user, position));
}

/**
* Returns where the user last disconnected from a server
Expand Down

0 comments on commit 3828581

Please sign in to comment.