<commit_before><?php

namespace BlockHorizons\BlockPets\pets;

abstract class HoveringPet extends BasePet {

	public $gravity = 0;

	public function onUpdate($currentTick) {
		$petOwner = $this->getPetOwner();
		if($petOwner === null) {
			$this->despawnFromAll();
			return false;
		}
		if($this->distance($petOwner) >= 30 || $this->getLevel()->getName() !== $petOwner->getLevel()->getName()) {
			$this->teleport($petOwner);
			$this->spawnToAll();
		}
		foreach($this->getLevel()->getPlayers() as $player) {
			if(!$this->hasSpawned[$player->getLoaderId()]) {
				$this->spawnTo($player);
			}
		}
		$x = $petOwner->x - $this->x;
		$y = $petOwner->y + 1 - $this->y;
		$z = $petOwner->z - $this->z;

		if($x * $x + $z * $z < 8) {
			$this->motionX = 0;
			$this->motionZ = 0;
		} else {
			$this->motionX = $this->getSpeed() * 0.15 * ($x / (abs($x) + abs($z)));<commit_msg>Fail...<commit_after><?php

namespace BlockHorizons\BlockPets\pets;

abstract class HoveringPet extends BasePet {

	public $gravity = 0;

	public function onUpdate($currentTick) {
		$petOwner = $this->getPetOwner();
		if($petOwner === null) {
			$this->despawnFromAll();
			return false;
		}
		if($this->distance($petOwner) >= 30 || $this->getLevel()->getName() !== $petOwner->getLevel()->getName()) {
			$this->teleport($petOwner);
			$this->spawnToAll();
		}
		foreach($this->getLevel()->getPlayers() as $player) {
			if(!isset($this->hasSpawned[$player->getLoaderId()])) {
				$this->spawnTo($player);
			}
		}
		$x = $petOwner->x - $this->x;
		$y = $petOwner->y + 1 - $this->y;
		$z = $petOwner->z - $this->z;

		if($x * $x + $z * $z < 8) {
			$this->motionX = 0;
			$this->motionZ = 0;
		} else {
			$this->motionX = $this->getSpeed() * 0.15 * ($x / (abs($x) + abs($z)));
{'fraction_non_alphanumeric': 0.23472301541976015, 'fraction_numerical': 0.011422044545973729, 'mean_word_length': 3.634920634920635, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 53, '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': '5365', 'n_tokens_mistral': 767, 'n_tokens_neox': 672, 'n_words': 115}