Cleanup: Better specify exception catch and remove unused import
This commit is contained in:
parent
93f14a330d
commit
7a09c53bde
|
@ -1,6 +1,5 @@
|
||||||
package com.Acrobot.ChestShop.Listeners.PreShopCreation;
|
package com.Acrobot.ChestShop.Listeners.PreShopCreation;
|
||||||
|
|
||||||
import com.Acrobot.Breeze.Utils.QuantityUtil;
|
|
||||||
import com.Acrobot.ChestShop.Configuration.Properties;
|
import com.Acrobot.ChestShop.Configuration.Properties;
|
||||||
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
|
import com.Acrobot.ChestShop.Events.PreShopCreationEvent;
|
||||||
import com.Acrobot.ChestShop.Signs.ChestShopSign;
|
import com.Acrobot.ChestShop.Signs.ChestShopSign;
|
||||||
|
@ -20,7 +19,7 @@ public class QuantityChecker implements Listener {
|
||||||
int amount = -1;
|
int amount = -1;
|
||||||
try {
|
try {
|
||||||
amount = ChestShopSign.getQuantity(event.getSignLines());
|
amount = ChestShopSign.getQuantity(event.getSignLines());
|
||||||
} catch (NumberFormatException notANumber) {}
|
} catch (NumberFormatException ignored) {} // not a quantity on the line
|
||||||
|
|
||||||
if (amount < 1 || amount > Properties.MAX_SHOP_AMOUNT) {
|
if (amount < 1 || amount > Properties.MAX_SHOP_AMOUNT) {
|
||||||
event.setOutcome(INVALID_QUANTITY);
|
event.setOutcome(INVALID_QUANTITY);
|
||||||
|
|
Loading…
Reference in New Issue