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

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

import java.util.List;
import com.hypixel.hytale.server.core.util.message.MessageFormat;
import java.util.Set;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.function.Function;
import io.netty.channel.Channel;
import java.util.Collection;
import com.hypixel.hytale.server.core.io.ServerManager;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;

public class BindingsCommand extends CommandBase
{
    @Nonnull
    private static final Message MESSAGE_IO_SERVER_MANAGER_BINDINGS;
    
    public BindingsCommand() {
        super("bindings", "server.io.servermanager.bindings");
    }
    
    @Override
    protected void executeSync(@Nonnull final CommandContext context) {
        final List<Channel> listeners = ServerManager.get().getListeners();
        context.sendMessage(MessageFormat.list(BindingsCommand.MESSAGE_IO_SERVER_MANAGER_BINDINGS, (Collection<Message>)listeners.stream().map((Function<? super Object, ?>)Channel::toString).map((Function<? super Object, ?>)Message::raw).collect((Collector<? super Object, ?, Set<? super Object>>)Collectors.toSet())));
    }
    
    static {
        MESSAGE_IO_SERVER_MANAGER_BINDINGS = Message.translation("server.io.servermanager.bindings");
    }
}
