mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-27 04:35:21 +01:00
Update to support newly available built-in Bukkit "superperms" permission system, though it will still use the Permissions plugin instead if that's available
Updated Bukkit JAR Added LocalAreaChat plugin to the softdepend list so it's loaded first
This commit is contained in:
parent
2730fa1253
commit
19176ada2f
Binary file not shown.
@ -268,56 +268,52 @@ public class Factions extends JavaPlugin {
|
|||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
public static boolean hasPermParticipate(CommandSender sender) {
|
public static boolean hasPermParticipate(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.participate", false);
|
return hasPerm(sender, "factions.participate");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermCreate(CommandSender sender) {
|
public static boolean hasPermCreate(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.create", false);
|
return hasPerm(sender, "factions.create");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermManageSafeZone(CommandSender sender) {
|
public static boolean hasPermManageSafeZone(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.manageSafeZone", true);
|
return hasPerm(sender, "factions.manageSafeZone");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermManageWarZone(CommandSender sender) {
|
public static boolean hasPermManageWarZone(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.manageWarZone", true);
|
return hasPerm(sender, "factions.manageWarZone");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermAdminBypass(CommandSender sender) {
|
public static boolean hasPermAdminBypass(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.adminBypass", true);
|
return hasPerm(sender, "factions.adminBypass");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermReload(CommandSender sender) {
|
public static boolean hasPermReload(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.reload", true);
|
return hasPerm(sender, "factions.reload");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermSaveAll(CommandSender sender) {
|
public static boolean hasPermSaveAll(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.saveall", true);
|
return hasPerm(sender, "factions.saveall");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermLock(CommandSender sender) {
|
public static boolean hasPermLock(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.lock", true);
|
return hasPerm(sender, "factions.lock");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermDisband(CommandSender sender) {
|
public static boolean hasPermDisband(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.disband", true);
|
return hasPerm(sender, "factions.disband");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPermWorlds(CommandSender sender) {
|
public static boolean hasPermWorlds(CommandSender sender) {
|
||||||
return hasPerm(sender, "factions.worldOptions", true);
|
return hasPerm(sender, "factions.worldOptions");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasPerm(CommandSender sender, String permNode, boolean fallbackOnlyOp) {
|
private static boolean hasPerm(CommandSender sender, String permNode) {
|
||||||
if (Factions.Permissions == null || ! (sender instanceof Player)) {
|
if (Factions.Permissions == null || ! (sender instanceof Player)) {
|
||||||
return fallbackOnlyOp == false || sender.isOp();
|
return sender.isOp() || sender.hasPermission(permNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sender instanceof Player) {
|
Player player = (Player)sender;
|
||||||
Player player = (Player)sender;
|
return Factions.Permissions.has(player, permNode);
|
||||||
return Factions.Permissions.has(player, permNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
@ -7,7 +7,52 @@ softdepend:
|
|||||||
- EssentialsChat
|
- EssentialsChat
|
||||||
- HeroChat
|
- HeroChat
|
||||||
- iChat
|
- iChat
|
||||||
|
- LocalAreaChat
|
||||||
commands:
|
commands:
|
||||||
f:
|
f:
|
||||||
description: All of the Factions commands
|
description: All of the Factions commands
|
||||||
usage: See documentation.
|
usage: See documentation.
|
||||||
|
permissions:
|
||||||
|
factions.*:
|
||||||
|
description: Grants all Factions permissions
|
||||||
|
children:
|
||||||
|
factions.participate: true
|
||||||
|
factions.create: true
|
||||||
|
factions.manageSafeZone: true
|
||||||
|
factions.manageWarZone: true
|
||||||
|
factions.adminBypass: true
|
||||||
|
factions.reload: true
|
||||||
|
factions.saveall: true
|
||||||
|
factions.lock: true
|
||||||
|
factions.disband: true
|
||||||
|
factions.worldOptions: true
|
||||||
|
factions.participate:
|
||||||
|
description: Allows the player to participate in a faction
|
||||||
|
default: true
|
||||||
|
factions.create:
|
||||||
|
description: Allows the player to create a new faction
|
||||||
|
default: true
|
||||||
|
factions.manageSafeZone:
|
||||||
|
description: Allows the player to claim land as a safe zone, and to build/destroy within safe zones
|
||||||
|
default: op
|
||||||
|
factions.manageWarZone:
|
||||||
|
description: Allows the player to claim land as a war zone, and to build/destroy within war zones
|
||||||
|
default: op
|
||||||
|
factions.adminBypass:
|
||||||
|
description: Allows the player to bypass many normal restrictions, and use the bypass command
|
||||||
|
default: op
|
||||||
|
factions.reload:
|
||||||
|
description: Can use the /f reload command to reload data file(s) from disk
|
||||||
|
default: op
|
||||||
|
factions.saveall:
|
||||||
|
description: Can use the /f saveall command to save all data to disk
|
||||||
|
default: op
|
||||||
|
factions.lock:
|
||||||
|
description: Can use the /f lock [on/off] command to temporarily lock the data files from being overwritten
|
||||||
|
default: op
|
||||||
|
factions.disband:
|
||||||
|
description: Can use the /f disband <faction> command to disband any faction
|
||||||
|
default: op
|
||||||
|
factions.worldOptions:
|
||||||
|
description: Can use the /f worldnoclaim and /f worldnopowerloss commands
|
||||||
|
default: op
|
||||||
|
Loading…
Reference in New Issue
Block a user