diff --git a/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java b/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java index 98d1d34..0753a67 100644 --- a/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java +++ b/src/main/java/com/Acrobot/ChestShop/Configuration/Messages.java @@ -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!"; diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/Modules/PriceRestrictionModule.java b/src/main/java/com/Acrobot/ChestShop/Listeners/Modules/PriceRestrictionModule.java index 4f99d71..b94d5e7 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/Modules/PriceRestrictionModule.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/Modules/PriceRestrictionModule.java @@ -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));