Skip to content

Commit

Permalink
Fix stack trace when buying from sign when inventory full (#5761)
Browse files Browse the repository at this point in the history
  • Loading branch information
rymiel committed Apr 13, 2024
1 parent c85e179 commit c60ed56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri

charge.isAffordableFor(player);
if (!items.pay(player)) {
throw new ChargeException("Inventory full"); //TODO: TL
throw new ChargeException("inventoryFull");
}
charge.charge(player);
Trade.log("Sign", "Buy", "Interact", username, charge, username, items, sign.getBlock().getLocation(), player.getMoney(), ess);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri
if (!trade.pay(player)) {
subtractAmount(sign, 1, charge, ess);
addAmount(sign, 2, trade, ess);
throw new ChargeException("Full inventory");
throw new ChargeException("inventoryFull");
}
charge.charge(player);
Trade.log("Sign", "Trade", "Interact", sign.getLine(3).substring(2), charge, username, trade, sign.getBlock().getLocation(), player.getMoney(), ess);
Expand Down
1 change: 1 addition & 0 deletions Essentials/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ inventoryClearingAllArmor=<primary>Cleared all inventory items and armor from<se
inventoryClearingAllItems=<primary>Cleared all inventory items from<secondary> {0}<primary>.
inventoryClearingFromAll=<primary>Clearing the inventory of all users...
inventoryClearingStack=<primary>Removed<secondary> {0} <primary>of<secondary> {1} <primary>from<secondary> {2}<primary>.
inventoryFull=<dark_red>Your inventory is full.
invseeCommandDescription=See the inventory of other players.
invseeCommandUsage=/<command> <player>
invseeCommandUsage1=/<command> <player>
Expand Down

0 comments on commit c60ed56

Please sign in to comment.