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

import net.minecraft.world.entity.ai.Brain;
import net.minecraft.server.level.ServerLevel;
import java.util.Map;
import net.minecraft.world.entity.ai.memory.WalkTarget;
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.LivingEntity;

public class SetWalkTargetFromLookTarget extends Behavior<LivingEntity> {
    private final float speedModifier;
    private final int closeEnoughDistance;
    
    public SetWalkTargetFromLookTarget(final float float1, final int integer) {
        super(ImmutableMap.<MemoryModuleType<WalkTarget>, MemoryStatus>of(MemoryModuleType.WALK_TARGET, MemoryStatus.VALUE_ABSENT, (MemoryModuleType<WalkTarget>)MemoryModuleType.LOOK_TARGET, MemoryStatus.VALUE_PRESENT));
        this.speedModifier = float1;
        this.closeEnoughDistance = integer;
    }
    
    @Override
    protected void start(final ServerLevel zd, final LivingEntity aoy, final long long3) {
        final Brain<?> apr6 = aoy.getBrain();
        final PositionTracker arn7 = apr6.<PositionTracker>getMemory(MemoryModuleType.LOOK_TARGET).get();
        apr6.<WalkTarget>setMemory(MemoryModuleType.WALK_TARGET, new WalkTarget(arn7, this.speedModifier, this.closeEnoughDistance));
    }
}
