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

package com.hypixel.hytale.builtin.portals.components.voidevent;

import javax.annotation.Nullable;
import com.hypixel.hytale.builtin.portals.integrations.PortalGameplayConfig;
import com.hypixel.hytale.builtin.portals.components.voidevent.config.VoidEventConfig;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.builtin.portals.PortalsPlugin;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.builtin.portals.components.voidevent.config.VoidEventStage;
import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.builtin.portals.utils.spatial.SpatialHashGrid;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Component;

public class VoidEvent implements Component<EntityStore>
{
    public static final double MIN_BLOCKS_BETWEEN_SPAWNERS = 62.0;
    private SpatialHashGrid<Ref<EntityStore>> voidSpawners;
    private VoidEventStage activeStage;
    
    public VoidEvent() {
        this.voidSpawners = new SpatialHashGrid<Ref<EntityStore>>(62.0);
    }
    
    public static ComponentType<EntityStore, VoidEvent> getComponentType() {
        return PortalsPlugin.getInstance().getVoidEventComponentType();
    }
    
    public VoidEventConfig getConfig(final World world) {
        final PortalGameplayConfig portalConfig = world.getGameplayConfig().getPluginConfig().get((Class<? extends PortalGameplayConfig>)PortalGameplayConfig.class);
        return portalConfig.getVoidEvent();
    }
    
    public SpatialHashGrid<Ref<EntityStore>> getVoidSpawners() {
        return this.voidSpawners;
    }
    
    @Nullable
    public VoidEventStage getActiveStage() {
        return this.activeStage;
    }
    
    public void setActiveStage(@Nullable final VoidEventStage activeStage) {
        this.activeStage = activeStage;
    }
    
    @Nullable
    @Override
    public Component<EntityStore> clone() {
        final VoidEvent clone = new VoidEvent();
        clone.voidSpawners = this.voidSpawners;
        clone.activeStage = this.activeStage;
        return clone;
    }
}
