mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-24 01:58:18 +01:00
Added config for op permissions
This commit is contained in:
parent
3b05b9be11
commit
8c5f7ef020
@ -57,6 +57,7 @@ public class WorldConfiguration {
|
|||||||
private SignChestProtection chestProtection = new SignChestProtection();
|
private SignChestProtection chestProtection = new SignChestProtection();
|
||||||
|
|
||||||
/* Configuration data start */
|
/* Configuration data start */
|
||||||
|
public boolean opPermissions;
|
||||||
public boolean fireSpreadDisableToggle;
|
public boolean fireSpreadDisableToggle;
|
||||||
public boolean enforceOneSession;
|
public boolean enforceOneSession;
|
||||||
public boolean itemDurability;
|
public boolean itemDurability;
|
||||||
@ -147,6 +148,8 @@ private void loadConfiguration() {
|
|||||||
Configuration config = new Configuration(this.configFile);
|
Configuration config = new Configuration(this.configFile);
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
|
opPermissions = config.getBoolean("op-permissions", true);
|
||||||
|
|
||||||
enforceOneSession = config.getBoolean("protection.enforce-single-session", true);
|
enforceOneSession = config.getBoolean("protection.enforce-single-session", true);
|
||||||
itemDurability = config.getBoolean("protection.item-durability", true);
|
itemDurability = config.getBoolean("protection.item-durability", true);
|
||||||
removeInfiniteStacks = config.getBoolean("protection.remove-infinite-stacks", false);
|
removeInfiniteStacks = config.getBoolean("protection.remove-infinite-stacks", false);
|
||||||
|
@ -276,8 +276,15 @@ public String toName(CommandSender sender) {
|
|||||||
*/
|
*/
|
||||||
public boolean hasPermission(CommandSender sender, String perm) {
|
public boolean hasPermission(CommandSender sender, String perm) {
|
||||||
if (sender.isOp()) {
|
if (sender.isOp()) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
if (this.getGlobalConfiguration().get(((Player) sender).
|
||||||
|
getWorld()).opPermissions) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Invoke the permissions resolver
|
// Invoke the permissions resolver
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
|
Loading…
Reference in New Issue
Block a user