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

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

import com.hypixel.hytale.component.dependency.SystemDependency;
import com.hypixel.hytale.server.core.modules.entity.tracker.EntityTrackerSystems;
import com.hypixel.hytale.component.dependency.Order;
import com.hypixel.hytale.component.CommandBuffer;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.component.ArchetypeChunk;
import com.hypixel.hytale.server.core.entity.effect.EffectControllerComponent;
import com.hypixel.hytale.component.query.Query;
import javax.annotation.Nonnull;
import com.hypixel.hytale.component.dependency.Dependency;
import java.util.Set;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.component.system.tick.EntityTickingSystem;

public class LivingEntityEffectClearChangesSystem extends EntityTickingSystem<EntityStore>
{
    @Nonnull
    private static final Set<Dependency<EntityStore>> DEPENDENCIES;
    
    @Nonnull
    @Override
    public Query<EntityStore> getQuery() {
        return EffectControllerComponent.getComponentType();
    }
    
    @Nonnull
    @Override
    public Set<Dependency<EntityStore>> getDependencies() {
        return LivingEntityEffectClearChangesSystem.DEPENDENCIES;
    }
    
    @Override
    public void tick(final float dt, final int index, @Nonnull final ArchetypeChunk<EntityStore> archetypeChunk, @Nonnull final Store<EntityStore> store, @Nonnull final CommandBuffer<EntityStore> commandBuffer) {
        final EffectControllerComponent effectControllerComponent = archetypeChunk.getComponent(index, EffectControllerComponent.getComponentType());
        assert effectControllerComponent != null;
        effectControllerComponent.clearChanges();
    }
    
    static {
        DEPENDENCIES = Set.of(new SystemDependency(Order.AFTER, EntityTrackerSystems.EffectControllerSystem.class));
    }
}
