Forgot to fix compilation errors

This commit is contained in:
Marc Baloup 2021-07-20 01:11:22 +02:00
parent 9e50206aee
commit 326ee13bef
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -26,7 +26,6 @@ import fr.pandacube.lib.core.permissions.SQLPermissions.EntityType;
import fr.pandacube.lib.core.players.PlayerFinder; import fr.pandacube.lib.core.players.PlayerFinder;
import fr.pandacube.lib.core.util.Log; import fr.pandacube.lib.core.util.Log;
import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
public class PermissionsResolver { public class PermissionsResolver {
@ -108,9 +107,8 @@ public class PermissionsResolver {
if (resolutionResult.conflict) { if (resolutionResult.conflict) {
Log.warning("For data " + dataType + ":"); Log.warning("For data " + dataType + ":");
BaseComponent[] cmps = ChatUtil.treeView(resolutionResult.toDisplayTreeNode(), true); for (Chat cmp : ChatUtil.treeView(resolutionResult.toDisplayTreeNode(), true))
for (BaseComponent cmp : cmps) Log.warning(cmp.getLegacyText());
Log.warning(cmp.toLegacyText());
} }
return resolutionResult.result != null ? resolutionResult.result : ""; return resolutionResult.result != null ? resolutionResult.result : "";
@ -175,11 +173,11 @@ public class PermissionsResolver {
c.thenLegacyText(" \"" + ChatColor.RESET + result + ChatColor.RESET + "\""); c.thenLegacyText(" \"" + ChatColor.RESET + result + ChatColor.RESET + "\"");
if (conflictMessage != null) if (conflictMessage != null)
c.thenFailure(" " + conflictMessage); c.thenFailure(" " + conflictMessage);
DisplayTreeNode node = new DisplayTreeNode(c.get()); DisplayTreeNode node = new DisplayTreeNode(c);
if (result == null && conflict == false && !inheritances.isEmpty()) { if (result == null && conflict == false && !inheritances.isEmpty()) {
// there is nothing interesting to show on current or subnode // there is nothing interesting to show on current or subnode
node.children.add(new DisplayTreeNode(Chat.text("(Inheritances hidden for brevety)").darkGray().italic().get())); node.children.add(new DisplayTreeNode(Chat.text("(Inheritances hidden for brevety)").darkGray().italic()));
return node; return node;
} }
@ -312,9 +310,8 @@ public class PermissionsResolver {
if (resolutionResult.conflict) { if (resolutionResult.conflict) {
Log.warning("For permission " + permission + ":"); Log.warning("For permission " + permission + ":");
BaseComponent[] cmps = ChatUtil.treeView(resolutionResult.toDisplayTreeNode(), true); for (Chat cmp : ChatUtil.treeView(resolutionResult.toDisplayTreeNode(), true))
for (BaseComponent cmp : cmps) Log.warning(cmp.getLegacyText());
Log.warning(cmp.toLegacyText());
} }
return resolutionResult.result; return resolutionResult.result;
@ -519,13 +516,13 @@ public class PermissionsResolver {
c.thenData(" w=" + world); c.thenData(" w=" + world);
if (conflictMessage != null) if (conflictMessage != null)
c.then(Chat.failureText(" " + conflictMessage)); c.then(Chat.failureText(" " + conflictMessage));
DisplayTreeNode node = new DisplayTreeNode(c.get()); DisplayTreeNode node = new DisplayTreeNode(c);
selfPermissions.forEach(p -> node.children.add(p.toDisplayTreeNode())); selfPermissions.forEach(p -> node.children.add(p.toDisplayTreeNode()));
if (result == PermState.UNDEFINED && conflict == false && !inheritances.isEmpty()) { if (result == PermState.UNDEFINED && conflict == false && !inheritances.isEmpty()) {
// there is nothing interesting to show on current or subnode // there is nothing interesting to show on current or subnode
node.children.add(new DisplayTreeNode(Chat.text("(Inheritances hidden for brevety)").darkGray().italic().get())); node.children.add(new DisplayTreeNode(Chat.text("(Inheritances hidden for brevety)").darkGray().italic()));
return node; return node;
} }
@ -547,8 +544,7 @@ public class PermissionsResolver {
public DisplayTreeNode toDisplayTreeNode() { public DisplayTreeNode toDisplayTreeNode() {
return new DisplayTreeNode(Chat.chat() return new DisplayTreeNode(Chat.chat()
.then(result ? Chat.successText("") : Chat.failureText("")) .then(result ? Chat.successText("") : Chat.failureText(""))
.then(Chat.text(permission).color(type == PermType.WILDCARD ? ChatColor.YELLOW : type == PermType.SPECIAL ? ChatColor.LIGHT_PURPLE : ChatColor.WHITE)) .then(Chat.text(permission).color(type == PermType.WILDCARD ? ChatColor.YELLOW : type == PermType.SPECIAL ? ChatColor.LIGHT_PURPLE : ChatColor.WHITE)));
.get());
} }
} }