Force refreshPermissions in API when you think is usefull to do it

This commit is contained in:
Michel Roux 2012-05-15 00:25:05 +02:00
parent 31c7d8cd7f
commit 9d8879f0b2

View File

@ -16,46 +16,55 @@ public class SimplyAPI implements PermsConfig {
@Override @Override
public void removePlayer(String player) { public void removePlayer(String player) {
plugin.config.removePlayer(player); plugin.config.removePlayer(player);
refreshPermissions();
} }
@Override @Override
public void removePlayerGroups(String player) { public void removePlayerGroups(String player) {
plugin.config.removePlayerGroups(player); plugin.config.removePlayerGroups(player);
refreshPermissions();
} }
@Override @Override
public void removePlayerGroup(String player, String group) { public void removePlayerGroup(String player, String group) {
plugin.config.removePlayerGroup(player, group); plugin.config.removePlayerGroup(player, group);
refreshPermissions();
} }
@Override @Override
public void addPlayerGroup(String player, String group) { public void addPlayerGroup(String player, String group) {
plugin.config.addPlayerGroup(player, group); plugin.config.addPlayerGroup(player, group);
refreshPermissions();
} }
@Override @Override
public void addPlayerPermission(String player, String permission, boolean value) { public void addPlayerPermission(String player, String permission, boolean value) {
plugin.config.addPlayerPermission(player, permission, value); plugin.config.addPlayerPermission(player, permission, value);
refreshPermissions();
} }
@Override @Override
public void addPlayerPermission(String player, String world, String permission, boolean value) { public void addPlayerPermission(String player, String world, String permission, boolean value) {
plugin.config.addPlayerPermission(player, world, permission, value); plugin.config.addPlayerPermission(player, world, permission, value);
refreshPermissions();
} }
@Override @Override
public void removePlayerPermissions(String player) { public void removePlayerPermissions(String player) {
plugin.config.removePlayerPermissions(player); plugin.config.removePlayerPermissions(player);
refreshPermissions();
} }
@Override @Override
public void removePlayerPermission(String player, String permission) { public void removePlayerPermission(String player, String permission) {
plugin.config.removePlayerPermission(player, permission); plugin.config.removePlayerPermission(player, permission);
refreshPermissions();
} }
@Override @Override
public void removePlayerPermission(String player, String world, String permission) { public void removePlayerPermission(String player, String world, String permission) {
plugin.config.removePlayerPermission(player, world, permission); plugin.config.removePlayerPermission(player, world, permission);
refreshPermissions();
} }
@Override @Override
@ -111,16 +120,19 @@ public class SimplyAPI implements PermsConfig {
@Override @Override
public void addGroupInheritance(String group, String inherit) { public void addGroupInheritance(String group, String inherit) {
plugin.config.addGroupInheritance(group, inherit); plugin.config.addGroupInheritance(group, inherit);
refreshPermissions();
} }
@Override @Override
public void removeGroupInheritance(String group, String inherit) { public void removeGroupInheritance(String group, String inherit) {
plugin.config.removeGroupInheritance(group, inherit); plugin.config.removeGroupInheritance(group, inherit);
refreshPermissions();
} }
@Override @Override
public void removeGroupInheritances(String group) { public void removeGroupInheritances(String group) {
plugin.config.removeGroupInheritances(group); plugin.config.removeGroupInheritances(group);
refreshPermissions();
} }
@Override @Override
@ -136,31 +148,37 @@ public class SimplyAPI implements PermsConfig {
@Override @Override
public void addGroupPermission(String group, String world, String permission, boolean value) { public void addGroupPermission(String group, String world, String permission, boolean value) {
plugin.config.addGroupPermission(group, world, permission, value); plugin.config.addGroupPermission(group, world, permission, value);
refreshPermissions();
} }
@Override @Override
public void addGroupPermission(String group, String permission, boolean value) { public void addGroupPermission(String group, String permission, boolean value) {
plugin.config.addGroupPermission(group, permission, value); plugin.config.addGroupPermission(group, permission, value);
refreshPermissions();
} }
@Override @Override
public void removeGroupPermission(String group, String world, String permission) { public void removeGroupPermission(String group, String world, String permission) {
plugin.config.removeGroupPermission(group, world, permission); plugin.config.removeGroupPermission(group, world, permission);
refreshPermissions();
} }
@Override @Override
public void removeGroupPermission(String group, String permission) { public void removeGroupPermission(String group, String permission) {
plugin.config.removeGroupPermission(group, permission); plugin.config.removeGroupPermission(group, permission);
refreshPermissions();
} }
@Override @Override
public void removeGroupPermissions(String group) { public void removeGroupPermissions(String group) {
plugin.config.removeGroupPermissions(group); plugin.config.removeGroupPermissions(group);
refreshPermissions();
} }
@Override @Override
public void removeGroup(String group) { public void removeGroup(String group) {
plugin.config.removeGroup(group); plugin.config.removeGroup(group);
refreshPermissions();
} }
@Override @Override
@ -176,11 +194,13 @@ public class SimplyAPI implements PermsConfig {
@Override @Override
public void addMessage(String key, String message) { public void addMessage(String key, String message) {
plugin.config.addMessage(key, message); plugin.config.addMessage(key, message);
refreshPermissions();
} }
@Override @Override
public void removeMessage(String key) { public void removeMessage(String key) {
plugin.config.removeMessage(key); plugin.config.removeMessage(key);
refreshPermissions();
} }
@Override @Override
@ -191,6 +211,7 @@ public class SimplyAPI implements PermsConfig {
@Override @Override
public void setDefaultGroup(String group) { public void setDefaultGroup(String group) {
plugin.config.setDefaultGroup(group); plugin.config.setDefaultGroup(group);
refreshPermissions();
} }
@Override @Override
@ -201,6 +222,7 @@ public class SimplyAPI implements PermsConfig {
@Override @Override
public void setDebug(boolean debug) { public void setDebug(boolean debug) {
plugin.config.setDebug(debug); plugin.config.setDebug(debug);
refreshPermissions();
} }
public void refreshPermissions() { public void refreshPermissions() {