<commit_before>package com.kirelcodes.RoboticCraft.pathFinders;

import com.kirelcodes.RoboticCraft.robot.RobotBase;

public class FollowPathfinder extends BasicPathfinder{

	private RobotBase robot;
	private int delayManager;
	
	public FollowPathfinder(RobotBase robot) {
		this.robot = robot;
		this.delayManager = 0;
	}
	
	@Override
	public boolean shouldStart() {
		return this.robot.isFollowing();
	}

	@Override
	public void updateTask() {
		if((delayManager%5)!=0)
			return;
		
	}
	
	@Override
	public void afterTask() {
		delayManager++;
	}

}<commit_msg>COmmit<commit_after>package com.kirelcodes.RoboticCraft.pathFinders;

import org.bukkit.Location;

import com.kirelcodes.RoboticCraft.robot.RobotBase;

public class FollowPathfinder extends BasicPathfinder{

	private RobotBase robot;
	private int delayManager;
	private int timeout;
	private Location previous;
	
	public FollowPathfinder(RobotBase robot) {
		this.robot = robot;
		this.delayManager = 0;
		this.timeout=0;
		previous = robot.getLocation();
	}
	
	@Override
	public boolean shouldStart() {
		return this.robot.isFollowing();
	}

	@Override
	public void updateTask() {
		if((delayManager%5)!=0)
			return;
		try {
			robot.setTargetLocation(robot.getFollowTarget().getLocation());
		} catch (Exception e) {robot.cancelFollow();}
		if((delayManager%20)!=0&&robot.getLocation().distance(previous)<=1){
			timeout++;
		}
		if(previous.distance(robot.getLocation())>1)
			timeout=0;
		if(timeout>=3){
			robot.setStuck(true);
		}
		if(timeout>=5&&robot.isStuck()){
			robot.getNavigator().teleport(robot.getFollowTarget());
			robot.setStuck(false);
			timeout=0;
		}
	}
	
	@Override
	public void afterTask() {
		delayManager++;
		previous=robot.getLocation();
	}

}
{'fraction_non_alphanumeric': 0.1276595744680851, 'fraction_numerical': 0.009200690051753882, 'mean_word_length': 4.8193979933110365, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3872215', 'n_tokens_mistral': 664, 'n_tokens_neox': 598, 'n_words': 106}