mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2025-01-09 16:47:36 +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
|
@PrecededBySpace
|
||||||
public static String SELL_PRICE_ABOVE_MAX = "Sell price is above maximum!";
|
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_ABOVE_MAX = "Buy price is above maximum!";
|
||||||
public static String BUY_PRICE_BELOW_MIN ="Buy price is below minimum!";
|
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.Events.PreShopCreationEvent.CreationOutcome.SELL_PRICE_BELOW_MIN;
|
||||||
import static com.Acrobot.ChestShop.Signs.ChestShopSign.ITEM_LINE;
|
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.PRICE_LINE;
|
||||||
|
import static com.Acrobot.ChestShop.Signs.ChestShopSign.QUANTITY_LINE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Acrobot
|
* @author Acrobot
|
||||||
@ -100,7 +101,12 @@ public class PriceRestrictionModule implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String itemType = material.getType().toString().toLowerCase();
|
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))) {
|
if (PriceUtil.hasBuyPrice(event.getSignLine(PRICE_LINE))) {
|
||||||
double buyPrice = PriceUtil.getBuyPrice(event.getSignLine(PRICE_LINE));
|
double buyPrice = PriceUtil.getBuyPrice(event.getSignLine(PRICE_LINE));
|
||||||
|
Loading…
Reference in New Issue
Block a user