diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 690bb89..7d1a2be 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 998d3bc..12c76ea 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.7.3-alpha1 +version: 3.7.3-alpha2 commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index 7255fe8..b8120eb 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -1613,6 +1613,9 @@ public class GenericFunctions { case TRAP_DOOR:{ return "Wooden Trapdoor"; } + case IRON_FENCE:{ + return "Iron Bars"; + } default:{ return GenericFunctions.CapitalizeFirstLetters(type.getType().toString().replace("_", " ")); } @@ -2806,8 +2809,29 @@ public class GenericFunctions { b.getType()==Material.SNOW || b.getType()==Material.SOUL_SAND) { return true; - } else { + } else { return false; } } + + public static boolean isBankSign(Sign s) { + return s.getLine(0).equalsIgnoreCase(ChatColor.AQUA+"-- BANK --"); + } + + public static boolean hasPermissionToBreakSign(Sign s, Player p) { + String[] lines = s.getLines(); + if (WorldShop.isWorldShopSign(s)) { + WorldShop shop = TwosideKeeper.TwosideShops.LoadWorldShopData(s); + if (shop.GetOwner().equalsIgnoreCase(p.getName()) || p.isOp()) { + return true; + } else { + return false; + } + } else + if (GenericFunctions.isBankSign(s)) { + return false; + } else { + return true; + } + } } diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java index 456e321..0c8c98b 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java @@ -799,11 +799,15 @@ public class WorldShop { public static boolean hasPermissionToBreakWorldShopSign(Sign s, Player p) { String[] lines = s.getLines(); - WorldShop shop = TwosideKeeper.TwosideShops.LoadWorldShopData(s); - if (shop.GetOwner().equalsIgnoreCase(p.getName()) || p.isOp()) { - return true; + if (WorldShop.isWorldShopSign(s)) { + WorldShop shop = TwosideKeeper.TwosideShops.LoadWorldShopData(s); + if (shop.GetOwner().equalsIgnoreCase(p.getName()) || p.isOp()) { + return true; + } else { + return false; + } } else { - return false; + return true; } } } diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java b/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java index f404aee..8191470 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java @@ -170,6 +170,11 @@ public final class TwosideKeeperAPI { return SpleefManager.playerIsPlayingSpleef(p); } + //Breaking COMMANDS. + public static boolean hasPermissionToBreakSign(Sign s, Player p) { + return GenericFunctions.hasPermissionToBreakSign(s,p); + } + //World Shop COMMANDS. public static boolean isWorldShop(Location l) { return WorldShop.shopSignExists(l);