From e7e66b142f2cf4008d5bb8908c6345f9e195691f Mon Sep 17 00:00:00 2001 From: meiamsome Date: Wed, 15 Aug 2012 01:22:55 +0200 Subject: [PATCH] Update com/Acrobot/ChestShop/Signs/ChestShopSign.java Updated to alternate fix. --- com/Acrobot/ChestShop/Signs/ChestShopSign.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/com/Acrobot/ChestShop/Signs/ChestShopSign.java b/com/Acrobot/ChestShop/Signs/ChestShopSign.java index f10e4ba..37e58b2 100644 --- a/com/Acrobot/ChestShop/Signs/ChestShopSign.java +++ b/com/Acrobot/ChestShop/Signs/ChestShopSign.java @@ -23,7 +23,7 @@ public class ChestShopSign { public static final Pattern[] SHOP_SIGN_PATTERN = { Pattern.compile("^$|^\\w.+$"), Pattern.compile("[0-9]+"), - Pattern.compile("(?i)(((b *[0-9]+)|([0-9]+ *b))|((s *[0-9]+)|([0-9]+ *s)))|((((b *[0-9]+)|([0-9]+ *b))[ ]*:[ ]*((s *[0-9]+)|([0-9]+ *s))))"), + Pattern.compile(".+"), Pattern.compile("[\\w : -]+") }; @@ -40,7 +40,8 @@ public class ChestShopSign { } public static boolean isValid(String[] line) { - return isValidPreparedSign(line) && !line[0].isEmpty(); + return isValidPreparedSign(line) && (line[2].toUpperCase().contains("B") || line[2].toUpperCase().contains("S")) && !line[0].isEmpty(); + } public static boolean isValid(Block sign) { @@ -60,5 +61,6 @@ public class ChestShopSign { return false; } } + return lines[2].indexOf(':') == lines[2].lastIndexOf(':'); } }