->Added hasPermissionToBreakSign(Sign, Player)

->Fixed return conditions for hasPermissionToBreakWorldShopSign()
dev
sigonasr2 9 years ago
parent 94d4a88948
commit d22b1c305f
  1. BIN
      TwosideKeeper.jar
  2. 2
      src/plugin.yml
  3. 26
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  4. 12
      src/sig/plugin/TwosideKeeper/HelperStructures/WorldShop.java
  5. 5
      src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java

Binary file not shown.

@ -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.

@ -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;
}
}
}

@ -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;
}
}
}

@ -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);

Loading…
Cancel
Save