Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setUserLastPosition to API #368

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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