->Added hasPermissionToBreakSign(Sign, Player)
->Fixed return conditions for hasPermissionToBreakWorldShopSign()
This commit is contained in:
parent
94d4a88948
commit
d22b1c305f
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…
x
Reference in New Issue
Block a user