Skip to content

Commit

Permalink
feat: Return item after failure or denial
Browse files Browse the repository at this point in the history
  • Loading branch information
blank038 committed Jun 11, 2024
1 parent c4b040d commit e3825a3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ private void performSellCommand(Player player, String[] args) {
.replace("%player%", player.getName()));
}
} else {
player.getInventory().addItem(cloneItem);
player.sendMessage(I18n.getStrAndHeader("sale-denied"));
}
});
future.exceptionally((e) -> {
ServerMarket.getInstance().getLogger().log(Level.WARNING, e, () -> "Please contact the author at https://github.com/blank038/ServerMarket/issues");
player.getInventory().addItem(cloneItem);
player.sendMessage(I18n.getStrAndHeader("sale-failed"));
return false;
});
Expand Down

0 comments on commit e3825a3

Please sign in to comment.