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

package com.hypixel.hytale.server.npc.commands;

import com.hypixel.hytale.component.ComponentAccessor;
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.universe.world.World;
import com.hypixel.hytale.server.npc.entities.NPCEntity;
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 com.hypixel.hytale.server.core.asset.type.model.config.ModelAsset;
import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;

public class NPCAppearanceCommand extends NPCWorldCommandBase
{
    @Nonnull
    private final RequiredArg<ModelAsset> modelArg;
    
    public NPCAppearanceCommand() {
        super("appearance", "server.commands.npc.appearance.desc");
        this.modelArg = this.withRequiredArg("model", "server.commands.npc.appearance.model.desc", ArgTypes.MODEL_ASSET);
    }
    
    @Override
    protected void execute(@Nonnull final CommandContext context, @Nonnull final NPCEntity npc, @Nonnull final World world, @Nonnull final Store<EntityStore> store, @Nonnull final Ref<EntityStore> ref) {
        final ModelAsset model = this.modelArg.get(context);
        npc.setAppearance(ref, model, store);
    }
}
