<commit_before>package ch.vorburger.minecraft.logo;

import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.util.Direction;
import org.spongepowered.api.world.Location;

/**
 * {@link Turtle} that is connected to a visible Entity, moving that Entity along.
 *
 * @author <NAME>
 */
public class EntityConnectedTurtle extends Turtle {

	private Entity companion;

	public EntityConnectedTurtle(Entity turtleEntity) {
		super(turtleEntity);
		this.companion = turtleEntity;
	}

	@Override
	protected void onMove(Location newLocation) {
		companion.setLocationSafely(newLocation);
	}
	
	@Override
	protected void onChangeDirection(Direction newDirection) {
		companion.setRotation(newDirection.toVector3d());
	}
}
<commit_msg>EntityConnectedTurtle setLocation is more natural than setLocationSafely<commit_after>package ch.vorburger.minecraft.logo;

import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.util.Direction;
import org.spongepowered.api.world.Location;

/**
 * {@link Turtle} that is connected to a visible Entity, moving that Entity
 * along.
 * 
 * Note that an Entity with AI such as a Pig will tend to turn and move away,
 * and is thus not very suitable as a Turtle. A Human is a bit better, but also
 * not perfectly ideal because it obviously obeys gravity and thus falls (TODO
 * How-To make it Fly??). Also when the Turtle is within existing blocks
 * rendering can be weired.
 *
 * @author <NAME>
 */
public class EntityConnectedTurtle extends Turtle {

	private Entity companion;

	public EntityConnectedTurtle(Entity turtleEntity) {
		super(turtleEntity);
		this.companion = turtleEntity;
	}

	@Override
	protected void onMove(Location newLocation) {
		// setLocation is better/clearer than setLocationSafely, for a Turtle -
		// even if it can lead to weired visuals of Entity-in-Block, but that's
		// still preferable to the alternative of the Companion Entity not
		// showing clearly where the Turtle is.
		companion.setLocation(newLocation);
	}
	
	@Override
	protected void onChangeDirection(Direction newDirection) {
		companion.setRotation(newDirection.toVector3d());
	}
}

{'fraction_non_alphanumeric': 0.08274894810659186, 'fraction_numerical': 0.0009350163627863488, 'mean_word_length': 4.691489361702128, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2898681', 'n_tokens_mistral': 675, 'n_tokens_neox': 617, 'n_words': 202}