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

package com.hypixel.hytale.builtin.teleport.commands.warp;

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 com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.permissions.HytalePermissions;
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 com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractPlayerCommand;

public class WarpGoCommand extends AbstractPlayerCommand
{
    @Nonnull
    private final RequiredArg<String> warpNameArg;
    
    public WarpGoCommand() {
        super("go", "server.commands.warp.go.desc");
        this.warpNameArg = this.withRequiredArg("warpName", "server.commands.warp.warpName.desc", ArgTypes.STRING);
        this.requirePermission(HytalePermissions.fromCommand("warp.go"));
    }
    
    @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 warpName = this.warpNameArg.get(context);
        WarpCommand.tryGo(context, warpName, ref, store);
    }
}
