mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Fixed dinerperms groups and bridge detection.
This commit is contained in:
parent
151b4c0fa1
commit
3f0da63b01
@ -60,7 +60,7 @@ public class DinnerPermsResolver implements PermissionsResolver {
|
||||
String perm = permAttach.getPermission();
|
||||
if (!perm.startsWith(GROUP_PREFIX))
|
||||
continue;
|
||||
groupNames.add(perm.substring(perm.indexOf(GROUP_PREFIX), perm.length()));
|
||||
groupNames.add(perm.substring(GROUP_PREFIX.length(), perm.length()));
|
||||
}
|
||||
return groupNames.toArray(new String[groupNames.size()]);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.bukkit.migration;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -43,7 +44,7 @@ public class NijiPermissionsResolver implements PermissionsResolver {
|
||||
if (plugin == null) {
|
||||
throw new MissingPluginException();
|
||||
}
|
||||
if (!checkRealNijiPerms(plugin, ignoreBridges))
|
||||
if (!checkRealNijiPerms(ignoreBridges))
|
||||
throw new MissingPluginException();
|
||||
|
||||
try {
|
||||
@ -130,12 +131,12 @@ public class NijiPermissionsResolver implements PermissionsResolver {
|
||||
private static final long serialVersionUID = 7044832912491608706L;
|
||||
}
|
||||
|
||||
public static boolean checkRealNijiPerms(Plugin plugin, boolean ignoreBridges) {
|
||||
public static boolean checkRealNijiPerms(boolean ignoreBridges) {
|
||||
if (!ignoreBridges)
|
||||
return true;
|
||||
PluginCommand permsCommand = plugin.getServer().getPluginCommand("permissions");
|
||||
PluginCommand permsCommand = Bukkit.getServer().getPluginCommand("permissions");
|
||||
if (permsCommand == null)
|
||||
return false;
|
||||
return !permsCommand.getPlugin().getDescription().getName().equals("Permissions");
|
||||
return permsCommand.getPlugin().getDescription().getName().equals("Permissions");
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class PermissionsResolverServerListener extends ServerListener {
|
||||
if (plugin instanceof PermissionsProvider) {
|
||||
manager.setPluginPermissionsResolver(plugin);
|
||||
} else if (name.equalsIgnoreCase("Permissions") &&
|
||||
NijiPermissionsResolver.checkRealNijiPerms(plugin, manager.ignoreNijiPermsBridges)) {
|
||||
NijiPermissionsResolver.checkRealNijiPerms(manager.ignoreNijiPermsBridges)) {
|
||||
manager.findResolver();
|
||||
manager.load();
|
||||
}
|
||||
@ -63,7 +63,7 @@ public class PermissionsResolverServerListener extends ServerListener {
|
||||
|
||||
if (plugin instanceof PermissionsProvider
|
||||
|| (name.equalsIgnoreCase("Permissions") &&
|
||||
NijiPermissionsResolver.checkRealNijiPerms(plugin, manager.ignoreNijiPermsBridges))) {
|
||||
NijiPermissionsResolver.checkRealNijiPerms(manager.ignoreNijiPermsBridges))) {
|
||||
manager.findResolver();
|
||||
manager.load();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user