Skip to content

Commit

Permalink
Fix submission of island. It was using old API.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Sep 26, 2021
1 parent 72e1ae0 commit 807bca5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public SubmissionsManager(CheckMeOut addon, BentoBox plugin) {
* @return true if successful, false if not
*/
public boolean addSubmission(final UUID playerUUID, final Location loc) {
BentoBox.getInstance().logDebug("add ing submittion " + playerUUID + " " + loc);
// Do not allow null players to set submissions
if (playerUUID == null || loc == null) {
return false;
Expand Down Expand Up @@ -176,7 +177,7 @@ public void removeSubmission(World world, UUID uuid) {
*/
public void saveSubmissions() {
submissionsData.setSubmissions(worldsSubmissionsList);
handler.saveObject(submissionsData);
handler.saveObjectAsync(submissionsData);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ public boolean canExecute(User user, String label, List<String> args) {
*/
@Override
public boolean execute(User user, String label, List<String> args) {
if (((CheckMeOut)getAddon()).getSubmissionsManager().addSubmission(user.getUniqueId(), getPlayers().getHomeLocation(getWorld(), user.getUniqueId()))) {
if (((CheckMeOut)getAddon()).getSubmissionsManager().addSubmission(user.getUniqueId(), getIslands().getHomeLocation(getWorld(), user.getUniqueId()))) {
user.sendMessage("general.success");
return true;
}
user.sendMessage("general.errors.general");
getAddon().logError("Could not submit island");
return false;
}

Expand Down

0 comments on commit 807bca5

Please sign in to comment.