mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-09 00:27:34 +01:00
Fix amount in price restriction not working correctly
Also fix copy and paste error in SELL_PRICE_BELOW_MIN error message.
This commit is contained in:
parent
91a372bd05
commit
20228dd645
@ -52,7 +52,7 @@ public class Messages {
|
||||
|
||||
@PrecededBySpace
|
||||
public static String SELL_PRICE_ABOVE_MAX = "Sell price is above maximum!";
|
||||
public static String SELL_PRICE_BELOW_MIN ="Buy price is below minimum!";
|
||||
public static String SELL_PRICE_BELOW_MIN ="Sell price is below minimum!";
|
||||
public static String BUY_PRICE_ABOVE_MAX = "Buy price is above maximum!";
|
||||
public static String BUY_PRICE_BELOW_MIN ="Buy price is below minimum!";
|
||||
|
||||
|
@ -22,6 +22,7 @@ import static com.Acrobot.ChestShop.Events.PreShopCreationEvent.CreationOutcome.
|
||||
import static com.Acrobot.ChestShop.Events.PreShopCreationEvent.CreationOutcome.SELL_PRICE_BELOW_MIN;
|
||||
import static com.Acrobot.ChestShop.Signs.ChestShopSign.ITEM_LINE;
|
||||
import static com.Acrobot.ChestShop.Signs.ChestShopSign.PRICE_LINE;
|
||||
import static com.Acrobot.ChestShop.Signs.ChestShopSign.QUANTITY_LINE;
|
||||
|
||||
/**
|
||||
* @author Acrobot
|
||||
@ -100,7 +101,12 @@ public class PriceRestrictionModule implements Listener {
|
||||
}
|
||||
|
||||
String itemType = material.getType().toString().toLowerCase();
|
||||
int amount = material.getAmount();
|
||||
int amount;
|
||||
try {
|
||||
amount = Integer.parseInt(event.getSignLine(QUANTITY_LINE));
|
||||
} catch (IllegalArgumentException e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (PriceUtil.hasBuyPrice(event.getSignLine(PRICE_LINE))) {
|
||||
double buyPrice = PriceUtil.getBuyPrice(event.getSignLine(PRICE_LINE));
|
||||
|
Loading…
Reference in New Issue
Block a user