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

package com.hypixel.hytale.builtin.buildertools.scriptedbrushes.commands;

import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.builtin.buildertools.tooloperations.ToolOperation;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Store;
import javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractPlayerCommand;
import com.hypixel.hytale.server.core.command.system.AbstractCommand;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractCommandCollection;

public class BrushConfigCommand extends AbstractCommandCollection
{
    public BrushConfigCommand() {
        super("scriptedbrushes", "Scripted brushes related commands");
        this.addAliases("scriptbrush", "scriptedbrush", "sb");
        this.requirePermission("hytale.editor.brush.config");
        this.addSubCommand(new BrushConfigClearCommand());
        this.addSubCommand(new BrushConfigListCommand());
        this.addSubCommand(new BrushConfigDebugStepCommand());
        this.addSubCommand(new BrushConfigExitCommand());
        this.addSubCommand(new BrushConfigLoadCommand());
        this.addSubCommand(new AbstractPlayerCommand(this, "info", "Information on the current brush configuration") {
            @Override
            protected void execute(@Nonnull final CommandContext context, @Nonnull final Store<EntityStore> store, @Nonnull final Ref<EntityStore> ref, @Nonnull final PlayerRef playerRef, @Nonnull final World world) {
                final String infoString = ToolOperation.getOrCreatePrototypeSettings(playerRef.getUuid()).getBrushConfig().getInfo();
                context.sendMessage(Message.raw(infoString));
            }
        });
    }
}
