mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57: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();
|
String perm = permAttach.getPermission();
|
||||||
if (!perm.startsWith(GROUP_PREFIX))
|
if (!perm.startsWith(GROUP_PREFIX))
|
||||||
continue;
|
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()]);
|
return groupNames.toArray(new String[groupNames.size()]);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.sk89q.bukkit.migration;
|
package com.sk89q.bukkit.migration;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -43,7 +44,7 @@ public class NijiPermissionsResolver implements PermissionsResolver {
|
|||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
throw new MissingPluginException();
|
throw new MissingPluginException();
|
||||||
}
|
}
|
||||||
if (!checkRealNijiPerms(plugin, ignoreBridges))
|
if (!checkRealNijiPerms(ignoreBridges))
|
||||||
throw new MissingPluginException();
|
throw new MissingPluginException();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -130,12 +131,12 @@ public class NijiPermissionsResolver implements PermissionsResolver {
|
|||||||
private static final long serialVersionUID = 7044832912491608706L;
|
private static final long serialVersionUID = 7044832912491608706L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkRealNijiPerms(Plugin plugin, boolean ignoreBridges) {
|
public static boolean checkRealNijiPerms(boolean ignoreBridges) {
|
||||||
if (!ignoreBridges)
|
if (!ignoreBridges)
|
||||||
return true;
|
return true;
|
||||||
PluginCommand permsCommand = plugin.getServer().getPluginCommand("permissions");
|
PluginCommand permsCommand = Bukkit.getServer().getPluginCommand("permissions");
|
||||||
if (permsCommand == null)
|
if (permsCommand == null)
|
||||||
return false;
|
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) {
|
if (plugin instanceof PermissionsProvider) {
|
||||||
manager.setPluginPermissionsResolver(plugin);
|
manager.setPluginPermissionsResolver(plugin);
|
||||||
} else if (name.equalsIgnoreCase("Permissions") &&
|
} else if (name.equalsIgnoreCase("Permissions") &&
|
||||||
NijiPermissionsResolver.checkRealNijiPerms(plugin, manager.ignoreNijiPermsBridges)) {
|
NijiPermissionsResolver.checkRealNijiPerms(manager.ignoreNijiPermsBridges)) {
|
||||||
manager.findResolver();
|
manager.findResolver();
|
||||||
manager.load();
|
manager.load();
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ public class PermissionsResolverServerListener extends ServerListener {
|
|||||||
|
|
||||||
if (plugin instanceof PermissionsProvider
|
if (plugin instanceof PermissionsProvider
|
||||||
|| (name.equalsIgnoreCase("Permissions") &&
|
|| (name.equalsIgnoreCase("Permissions") &&
|
||||||
NijiPermissionsResolver.checkRealNijiPerms(plugin, manager.ignoreNijiPermsBridges))) {
|
NijiPermissionsResolver.checkRealNijiPerms(manager.ignoreNijiPermsBridges))) {
|
||||||
manager.findResolver();
|
manager.findResolver();
|
||||||
manager.load();
|
manager.load();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user