package net.minecraft.advancements.critereon;

import net.minecraft.advancements.CriterionTriggerInstance;
import net.minecraft.server.level.ServerPlayer;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonObject;
import net.minecraft.resources.ResourceLocation;

public class TickTrigger extends SimpleCriterionTrigger<TriggerInstance> {
    public static final ResourceLocation ID;
    
    @Override
    public ResourceLocation getId() {
        return TickTrigger.ID;
    }
    
    @Override
    public TriggerInstance createInstance(final JsonObject jsonObject, final JsonDeserializationContext jsonDeserializationContext) {
        return new TriggerInstance();
    }
    
    public void trigger(final ServerPlayer xe) {
        this.trigger(xe.getAdvancements());
    }
    
    static {
        ID = new ResourceLocation("tick");
    }
    
    public static class TriggerInstance extends AbstractCriterionTriggerInstance {
        public TriggerInstance() {
            super(TickTrigger.ID);
        }
    }
}
