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

package com.hypixel.hytale.server.core.command.commands.world.chunk;

import com.hypixel.hytale.server.core.modules.entity.player.ChunkTracker;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import javax.annotation.Nullable;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Ref;
import javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractTargetPlayerCommand;

public class ChunkLoadedCommand extends AbstractTargetPlayerCommand
{
    public ChunkLoadedCommand() {
        super("loaded", "server.commands.chunk.loaded.desc");
    }
    
    @Override
    protected void execute(@Nonnull final CommandContext context, @Nullable final Ref<EntityStore> sourceRef, @Nonnull final Ref<EntityStore> ref, @Nonnull final PlayerRef playerRef, @Nonnull final World world, @Nonnull final Store<EntityStore> store) {
        final ChunkTracker chunkTracker = store.getComponent(ref, ChunkTracker.getComponentType());
        assert chunkTracker != null;
        context.sendMessage(chunkTracker.getLoadedChunksMessage());
    }
}
