Skip to content
Merged
Show file tree
Hide file tree
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 @@ -92,6 +92,11 @@ public static void buyItem(Player player, String itemId, int amount) {
ShopItem item = getCurrentItem(player, itemId);
if (item == null) return;

if (amount <= 0) {
sendError(player, TranslationManager.translation("feature.adminshop.amount_sup"));
return;
}

if (!ItemUtils.hasEnoughSpace(player, item.getMaterial(), amount)) {
sendError(player, TranslationManager.translation("feature.adminshop.inventory_full"));
return;
Expand Down Expand Up @@ -128,6 +133,11 @@ public static void sellItem(Player player, String itemId, int amount) {
ShopItem item = getCurrentItem(player, itemId); // Get the item from the current category
if (item == null) return;

if (amount <= 0) {
sendError(player, TranslationManager.translation("feature.adminshop.amount_sup"));
return;
}

// Check if the initial sell price is valid
if (item.getInitialSellPrice() <= 0) {
sendError(player, TranslationManager.translation("feature.adminshop.item_not_buyable"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ feature.adminshop.menu.log_variants.log=<gray>Bûches</gray>
feature.adminshop.have_enough_item=<red>Vous n'avez pas cet item dans votre inventaire !</red>
feature.adminshop.have_enough_money=<red>Vous n'avez pas assez d'argent !</red>
feature.adminshop.inventory_full=<red>Votre inventaire est plein !</red>
feature.adminshop.amount_sup=<red>La quantité choisie doit être supérieure à 0</red>
feature.adminshop.item_not_sellable=<red>Ce produit n'est pas vendable !</red>
feature.adminshop.item_not_buyable=<red>Ce produit n'est pas achetable !</red>
feature.adminshop.player_not_enough_item=<red>Vous n'avez pas assez de cet item dans votre inventaire !</red>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/translations/en_GB/adminshop.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ feature.adminshop.menu.log_variants.log=<gray>Logs</gray>
feature.adminshop.have_enough_item=<red>You do not have this item in your inventory!</red>
feature.adminshop.have_enough_money=<red>You don't have enough money!</red>
feature.adminshop.inventory_full=<red>Your inventory is full!</red>
feature.adminshop.amount_sup=<red>The quantity must be superior to 1!</red>
feature.adminshop.item_not_sellable=<red>This product is not for sale!</red>
feature.adminshop.item_not_buyable=<red>This product is not purchasable!</red>
feature.adminshop.player_not_enough_item=<red>You don't have enough of this item in your inventory!</red>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/translations/en_US/adminshop.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ feature.adminshop.menu.log_variants.log=<gray>Logs</gray>
feature.adminshop.have_enough_item=<red>You do not have this item in your inventory!</red>
feature.adminshop.have_enough_money=<red>You don't have enough money!</red>
feature.adminshop.inventory_full=<red>Your inventory is full!</red>
feature.adminshop.amount_sup=<red>The quantity must be superior to 1!</red>
feature.adminshop.item_not_sellable=<red>This product is not for sale!</red>
feature.adminshop.item_not_buyable=<red>This product is not purchasable!</red>
feature.adminshop.player_not_enough_item=<red>You don't have enough of this item in your inventory!</red>
Expand Down
Loading