mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-12-29 12:28:35 +01:00
Merge pull request #443 from hydrox/fixDroxPermsPrimaryGroupProblem
Fix DroxPerms interaction with primary group
This commit is contained in:
commit
fe0d8b76cb
Binary file not shown.
10
pom.xml
10
pom.xml
@ -57,6 +57,10 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
|
||||
<id>krinsoft</id>
|
||||
<url>http://files.krinsoft.net:8085/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>escapecraft-repo</id>
|
||||
<url>http://dev.escapecraft.com/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@ -73,11 +77,9 @@ Vault currently supports the following: Permissions 3, PEX, GroupManager, bPerms
|
||||
<systemPath>${project.basedir}/lib/MiConomy.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.hydrox.bukkit.DroxPerms</groupId>
|
||||
<groupId>de.hydrox.bukkit</groupId>
|
||||
<artifactId>DroxPerms</artifactId>
|
||||
<version>0.4.0-SNAPSHOT</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/DroxPerms-0.4.0-SNAPSHOT.jar</systemPath>
|
||||
<version>0.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.krinsoft</groupId>
|
||||
|
@ -20,6 +20,7 @@ public class Permission_DroxPerms extends Permission {
|
||||
|
||||
private final String name = "DroxPerms";
|
||||
private DroxPermsAPI API;
|
||||
private boolean useOnlySubgroups;
|
||||
|
||||
public Permission_DroxPerms(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
@ -30,6 +31,8 @@ public class Permission_DroxPerms extends Permission {
|
||||
if (p != null) {
|
||||
API = p.getAPI();
|
||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), "DroxPerms"));
|
||||
useOnlySubgroups = p.getConfig().getBoolean("Vault.useOnlySubgroups", true);
|
||||
log.info(String.format("[%s][Permission] Vault.useOnlySubgroups: %s", plugin.getDescription().getName(), useOnlySubgroups));
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,12 +115,28 @@ public class Permission_DroxPerms extends Permission {
|
||||
|
||||
@Override
|
||||
public boolean playerAddGroup(String world, String player, String group) {
|
||||
return API.addPlayerSubgroup(player, group);
|
||||
if (useOnlySubgroups) {
|
||||
return API.addPlayerSubgroup(player, group);
|
||||
} else {
|
||||
if ("default".equalsIgnoreCase(API.getPlayerGroup(player))) {
|
||||
return API.setPlayerGroup(player, group);
|
||||
} else {
|
||||
return API.addPlayerSubgroup(player, group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean playerRemoveGroup(String world, String player, String group) {
|
||||
return API.removePlayerSubgroup(player, group);
|
||||
if (useOnlySubgroups) {
|
||||
return API.removePlayerSubgroup(player, group);
|
||||
} else {
|
||||
if (group.equalsIgnoreCase(API.getPlayerGroup(player))) {
|
||||
return API.setPlayerGroup(player, "default");
|
||||
} else {
|
||||
return API.removePlayerSubgroup(player, group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user