package net.minecraft.world.entity.ai.behavior;

import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.npc.VillagerData;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.server.level.ServerLevel;
import java.util.Map;
import net.minecraft.core.GlobalPos;
import com.google.common.collect.ImmutableMap;
import net.minecraft.world.entity.ai.memory.MemoryStatus;
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
import net.minecraft.world.entity.npc.Villager;

public class ResetProfession extends Behavior<Villager> {
    public ResetProfession() {
        super(ImmutableMap.<MemoryModuleType<GlobalPos>, MemoryStatus>of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_ABSENT));
    }
    
    @Override
    protected boolean checkExtraStartConditions(final ServerLevel zd, final Villager bdp) {
        final VillagerData bdq4 = bdp.getVillagerData();
        return bdq4.getProfession() != VillagerProfession.NONE && bdq4.getProfession() != VillagerProfession.NITWIT && bdp.getVillagerXp() == 0 && bdq4.getLevel() <= 1;
    }
    
    @Override
    protected void start(final ServerLevel zd, final Villager bdp, final long long3) {
        bdp.setVillagerData(bdp.getVillagerData().setProfession(VillagerProfession.NONE));
        bdp.refreshBrain(zd);
    }
}
