package net.minecraft.data.tags;

import net.minecraft.tags.TagCollection;
import java.nio.file.Path;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.animal.Bee;
import net.minecraft.tags.Tag;
import net.minecraft.tags.EntityTypeTags;
import net.minecraft.core.Registry;
import net.minecraft.data.DataGenerator;
import net.minecraft.world.entity.EntityType;

public class EntityTypeTagsProvider extends TagsProvider<EntityType<?>> {
    public EntityTypeTagsProvider(final DataGenerator gy) {
        super(gy, Registry.ENTITY_TYPE);
    }
    
    @Override
    protected void addTags() {
        this.tag(EntityTypeTags.SKELETONS).add(EntityType.SKELETON, EntityType.STRAY, EntityType.WITHER_SKELETON);
        this.tag(EntityTypeTags.RAIDERS).add(EntityType.EVOKER, EntityType.PILLAGER, EntityType.RAVAGER, EntityType.VINDICATOR, EntityType.ILLUSIONER, EntityType.WITCH);
        ((TagsProvider<EntityType<Bee>>)this).tag((Tag<EntityType<Bee>>)EntityTypeTags.BEEHIVE_INHABITORS).add(EntityType.BEE);
        this.tag(EntityTypeTags.ARROWS).add(EntityType.ARROW, EntityType.SPECTRAL_ARROW);
    }
    
    @Override
    protected Path getPath(final ResourceLocation sm) {
        return this.generator.getOutputFolder().resolve("data/" + sm.getNamespace() + "/tags/entity_types/" + sm.getPath() + ".json");
    }
    
    @Override
    public String getName() {
        return "Entity Type Tags";
    }
    
    @Override
    protected void useTags(final TagCollection<EntityType<?>> aba) {
        EntityTypeTags.reset(aba);
    }
}
