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

package com.hypixel.hytale.server.core.modules.entity.component;

import com.hypixel.hytale.server.core.modules.entity.EntityModule;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.Component;

public class NewSpawnComponent implements Component<EntityStore>
{
    private float newSpawnWindow;
    
    public static ComponentType<EntityStore, NewSpawnComponent> getComponentType() {
        return EntityModule.get().getNewSpawnComponentType();
    }
    
    public NewSpawnComponent(final float newSpawnWindow) {
        this.newSpawnWindow = newSpawnWindow;
    }
    
    public boolean newSpawnWindowPassed(final float dt) {
        final float newSpawnWindow = this.newSpawnWindow - dt;
        this.newSpawnWindow = newSpawnWindow;
        return newSpawnWindow <= 0.0f;
    }
    
    @Override
    public Component<EntityStore> clone() {
        return new NewSpawnComponent(this.newSpawnWindow);
    }
}
