<commit_before><?php

declare(strict_types=1);

namespace BlockHorizons\BlockSniper\cloning\types;

use BlockHorizons\BlockSniper\brush\BaseShape;
use BlockHorizons\BlockSniper\cloning\BaseClone;
use BlockHorizons\BlockSniper\sessions\SessionManager;
use pocketmine\level\Position;
use pocketmine\Player;

class CopyType extends BaseClone{

	public function __construct(Player $player, bool $saveAir, BaseShape $shape){
		parent::__construct($player, $saveAir, Position::fromObject($shape->getCenter(), $player->getLevel()), $shape);
	}

	public function getName() : string{
		return "Copy";
	}

	public function saveClone() : void{
		SessionManager::getPlayerSession($this->player)->getCloneStore()->saveCopy($this->shape, $this->center);
	}
}
<commit_msg>Change copies to be centered at the bottom.<commit_after><?php

declare(strict_types=1);

namespace BlockHorizons\BlockSniper\cloning\types;

use BlockHorizons\BlockSniper\brush\BaseShape;
use BlockHorizons\BlockSniper\cloning\BaseClone;
use BlockHorizons\BlockSniper\sessions\SessionManager;
use pocketmine\level\Position;
use pocketmine\Player;

class CopyType extends BaseClone{

	public function __construct(Player $player, bool $saveAir, BaseShape $shape){
		$offset = ($shape->maxY - $shape->minY) / 2;
		parent::__construct($player, $saveAir, Position::fromObject($shape->getCenter()->subtract(0, $offset), $player->getLevel()), $shape);
	}

	public function getName() : string{
		return "Copy";
	}

	public function saveClone() : void{
		SessionManager::getPlayerSession($this->player)->getCloneStore()->saveCopy($this->shape, $this->center);
	}
}

{'fraction_non_alphanumeric': 0.14011159330440173, 'fraction_numerical': 0.0024798512089274642, 'mean_word_length': 6.911764705882353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '3223976', 'n_tokens_mistral': 526, 'n_tokens_neox': 517, 'n_words': 98}