Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Added support for newer versions of Permissions, in theory.
Dieser Commit ist enthalten in:
Ursprung
ac920fd5b6
Commit
fd2de1d264
@ -55,31 +55,44 @@ public class NijiPermissionsResolver implements PermissionsResolver {
|
|||||||
try {
|
try {
|
||||||
Player player = server.getPlayer(name);
|
Player player = server.getPlayer(name);
|
||||||
if (player == null) return false;
|
if (player == null) return false;
|
||||||
|
try {
|
||||||
|
return api.getHandler().has(player, permission);
|
||||||
|
} catch (Throwable t) {
|
||||||
return api.Security.permission(player, permission);
|
return api.Security.permission(player, permission);
|
||||||
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("static-access")
|
@SuppressWarnings({ "static-access", "deprecation" })
|
||||||
public boolean inGroup(String name, String group) {
|
public boolean inGroup(String name, String group) {
|
||||||
try {
|
try {
|
||||||
Player player = server.getPlayer(name);
|
Player player = server.getPlayer(name);
|
||||||
if (player == null) return false;
|
if (player == null) return false;
|
||||||
|
try {
|
||||||
|
return api.getHandler().inGroup(player.getWorld().getName(), name, group);
|
||||||
|
} catch (Throwable t) {
|
||||||
return api.Security.inGroup(name, group);
|
return api.Security.inGroup(name, group);
|
||||||
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("static-access")
|
@SuppressWarnings({ "static-access", "deprecation" })
|
||||||
public String[] getGroups(String name) {
|
public String[] getGroups(String name) {
|
||||||
try {
|
try {
|
||||||
Player player = server.getPlayer(name);
|
Player player = server.getPlayer(name);
|
||||||
if (player == null) return new String[0];
|
if (player == null) return new String[0];
|
||||||
String group = api.Security.getGroup(player.getName());
|
String group;
|
||||||
|
try {
|
||||||
|
group = api.getHandler().getGroup(player.getWorld().getName(), player.getName());
|
||||||
|
} catch (Throwable t) {
|
||||||
|
group = api.Security.getGroup(player.getName());
|
||||||
|
}
|
||||||
if (group == null) {
|
if (group == null) {
|
||||||
return new String[0];
|
return new String[0];
|
||||||
} else {
|
} else {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren