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

package com.hypixel.hytale.server.core.modules.debug.commands;

import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.server.core.modules.debug.DebugUtils;
import com.hypixel.hytale.math.vector.Vector3f;
import java.util.concurrent.ThreadLocalRandom;
import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
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 javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractPlayerCommand;

public class DebugShapeSphereCommand extends AbstractPlayerCommand
{
    @Nonnull
    private static final Message MESSAGE_COMMANDS_DEBUG_SHAPE_SPHERE_SUCCESS;
    
    public DebugShapeSphereCommand() {
        super("sphere", "server.commands.debug.shape.sphere.desc");
    }
    
    @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 TransformComponent transformComponent = store.getComponent(ref, TransformComponent.getComponentType());
        assert transformComponent != null;
        final Vector3d position = transformComponent.getPosition();
        final ThreadLocalRandom random = ThreadLocalRandom.current();
        final Vector3f color = new Vector3f(random.nextFloat(), random.nextFloat(), random.nextFloat());
        DebugUtils.addSphere(world, position, color, 2.0, 30.0f);
        context.sendMessage(DebugShapeSphereCommand.MESSAGE_COMMANDS_DEBUG_SHAPE_SPHERE_SUCCESS);
    }
    
    static {
        MESSAGE_COMMANDS_DEBUG_SHAPE_SPHERE_SUCCESS = Message.translation("server.commands.debug.shape.sphere.success");
    }
}
