Refactor paginated command output, add flags for ordering 'permission info' entries, fix crashes caused by long messages (#591)

This commit is contained in:
Luck
2017-12-16 21:05:43 +00:00
Unverified
parent 2e7a08c006
commit 904bb90385
29 changed files with 447 additions and 403 deletions
@@ -302,7 +302,7 @@ public class VaultChatHook extends Chat {
world = perms.correctWorld(world);
Contexts contexts;
if (holder instanceof User) {
if (holder.getType().isUser()) {
contexts = perms.createContextForWorldLookup(perms.getPlugin().getPlayer((User) holder), world);
} else {
contexts = perms.createContextForWorldLookup(world);
@@ -322,7 +322,7 @@ public class VaultChatHook extends Chat {
world = perms.correctWorld(world);
Contexts contexts;
if (holder instanceof User) {
if (holder.getType().isUser()) {
contexts = perms.createContextForWorldLookup(perms.getPlugin().getPlayer((User) holder), world);
} else {
contexts = perms.createContextForWorldLookup(world);
@@ -444,11 +444,11 @@ public class VaultPermissionHook extends Permission {
}
void holderSave(PermissionHolder holder) {
if (holder instanceof User) {
if (holder.getType().isUser()) {
User u = (User) holder;
plugin.getStorage().saveUser(u).thenRunAsync(() -> u.getRefreshBuffer().request(), plugin.getScheduler().async());
}
if (holder instanceof Group) {
if (holder.getType().isGroup()) {
Group g = (Group) holder;
plugin.getStorage().saveGroup(g).thenRunAsync(() -> plugin.getUpdateTaskBuffer().request(), plugin.getScheduler().async());
}