// 
// Decompiled by Procyon v0.6.0
// 

package com.hypixel.hytale.server.core.permissions.commands;

import java.util.Iterator;
import com.hypixel.hytale.server.core.command.system.CommandSender;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.arguments.types.ArgumentType;
import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
import javax.annotation.Nonnull;
import java.util.List;
import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;

public class PermTestCommand extends CommandBase
{
    @Nonnull
    private final RequiredArg<List<String>> nodesArg;
    
    public PermTestCommand() {
        super("test", "server.commands.testperm.desc");
        this.nodesArg = this.withListRequiredArg("nodes", "server.commands.perm.test.nodes.desc", ArgTypes.STRING);
    }
    
    @Override
    protected void executeSync(@Nonnull final CommandContext context) {
        final CommandSender sender = context.sender();
        final List<String> nodes = this.nodesArg.get(context);
        for (final String node : nodes) {
            context.sendMessage(Message.translation("server.commands.testperm.hasPermission").param("permission", node).param("hasPermission", sender.hasPermission(node)));
        }
    }
}
