Add setPlayerGroup in API
This commit is contained in:
parent
9d8879f0b2
commit
8b8a304476
@ -31,6 +31,12 @@ public class SimplyAPI implements PermsConfig {
|
|||||||
refreshPermissions();
|
refreshPermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPlayerGroup(String player, String group) {
|
||||||
|
plugin.config.setPlayerGroup(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);
|
||||||
|
@ -36,6 +36,12 @@ public class ConfigFile implements PermsConfig {
|
|||||||
plugin.getConfig().set("users/" + player + "/groups", (groups.isEmpty()) ? null : groups);
|
plugin.getConfig().set("users/" + player + "/groups", (groups.isEmpty()) ? null : groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPlayerGroup(String player, String group) {
|
||||||
|
removePlayerGroups(player);
|
||||||
|
addPlayerGroup(player, group);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addPlayerGroup(String player, String group) {
|
public void addPlayerGroup(String player, String group) {
|
||||||
player = player.toLowerCase();
|
player = player.toLowerCase();
|
||||||
|
@ -113,6 +113,12 @@ public class ConfigSQL implements PermsConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPlayerGroup(String player, String group) {
|
||||||
|
removePlayerGroups(player);
|
||||||
|
addPlayerGroup(player, group);
|
||||||
|
}
|
||||||
|
|
||||||
private void addPlayerGroup(String player, String group, boolean first) {
|
private void addPlayerGroup(String player, String group, boolean first) {
|
||||||
if (init()) {
|
if (init()) {
|
||||||
try {
|
try {
|
||||||
|
@ -11,6 +11,8 @@ public interface PermsConfig {
|
|||||||
|
|
||||||
public void removePlayerGroup(String player, String group);
|
public void removePlayerGroup(String player, String group);
|
||||||
|
|
||||||
|
public void setPlayerGroup(String player, String group);
|
||||||
|
|
||||||
public void addPlayerGroup(String player, String group);
|
public void addPlayerGroup(String player, String group);
|
||||||
|
|
||||||
public void addPlayerPermission(String player, String permission, boolean value);
|
public void addPlayerPermission(String player, String permission, boolean value);
|
||||||
|
Loading…
Reference in New Issue
Block a user