mirror of
https://github.com/PEXPlugins/Modifyworld.git
synced 2024-11-21 11:26:13 +01:00
Merge pull request #72 from daboross/patch-2
Allow Modifyworld to run without PEX being present
This commit is contained in:
commit
9697e148d3
@ -79,31 +79,38 @@ public class PlayerInformer {
|
||||
}
|
||||
|
||||
public String getMessage(Player player, String permission) {
|
||||
if (PermissionsEx.isAvailable()) {
|
||||
PermissionUser user = PermissionsEx.getUser(player);
|
||||
boolean permissionsExExists = true;
|
||||
try {
|
||||
Class permissionsExClass = Class.forName("ru.tehkode.permissions.bukkit.PermissionsEx");
|
||||
} catch (ClassNotFoundException e) {
|
||||
permissionsExExists = false;
|
||||
}
|
||||
if (permissionsExExists) {
|
||||
if (PermissionsEx.isAvailable()) {
|
||||
PermissionUser user = PermissionsEx.getUser(player);
|
||||
|
||||
String message;
|
||||
String perm = permission;
|
||||
int index;
|
||||
String message;
|
||||
String perm = permission;
|
||||
int index;
|
||||
|
||||
while ((index = perm.lastIndexOf(".")) != -1) {
|
||||
perm = perm.substring(0, index);
|
||||
while ((index = perm.lastIndexOf(".")) != -1) {
|
||||
perm = perm.substring(0, index);
|
||||
|
||||
message = user.getOption("permission-denied-" + perm, player.getWorld().getName(), null);
|
||||
if (message == null) {
|
||||
continue;
|
||||
message = user.getOption("permission-denied-" + perm, player.getWorld().getName(), null);
|
||||
if (message == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
message = user.getOption("permission-denied", player.getWorld().getName(), null);
|
||||
|
||||
message = user.getOption("permission-denied", player.getWorld().getName(), null);
|
||||
|
||||
if (message != null) {
|
||||
return message;
|
||||
if (message != null) {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return getMessage(permission);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user