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

package com.hypixel.hytale.builtin.portals.commands;

import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.builtin.portals.resources.PortalWorld;
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 javax.annotation.Nonnull;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractWorldCommand;

public abstract class PortalWorldCommandBase extends AbstractWorldCommand
{
    public PortalWorldCommandBase(final String name, final String description) {
        super(name, description);
    }
    
    @Override
    protected final void execute(@Nonnull final CommandContext context, @Nonnull final World world, @Nonnull final Store<EntityStore> store) {
        final PortalWorld portalWorld = store.getResource(PortalWorld.getResourceType());
        if (!portalWorld.exists()) {
            context.sendMessage(Message.translation("server.commands.portals.notInPortal"));
            return;
        }
        this.execute(context, world, portalWorld, store);
    }
    
    protected abstract void execute(@Nonnull final CommandContext p0, @Nonnull final World p1, @Nonnull final PortalWorld p2, @Nonnull final Store<EntityStore> p3);
}
