<commit_before><?php

namespace ifteam\ColorFul;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerChatEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\block\SignChangeEvent;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\utils\TextFormat;
use pocketmine\command\PluginCommand;
use pocketmine\utils\Config;

class ColorFul extends PluginBase implements Listener {
	public $m_version = 1;
	public $messages;
	public function onEnable() {
		$this->initMessage ();
		$this->registerCommand ( $this->get ( "colorTable" ), "colorful", $this->get ( "colorTable-desc" ), "/" . $this->get ( "colorTable" ) );
		
		$this->getServer ()->getPluginManager ()->registerEvents ( $this, $this );
	}
	public function onChat(PlayerChatEvent $event) {
		$event->setFormat ( $this->replaceColor ( $event->getFormat () ) );
		$event->setMessage ( $this->replaceColor ( $event->getMessage () ) );
	}
	public function onSign(SignChangeEvent $event) {
		$event->setLine ( 0, $this->replaceColor ( $event->getLine ( 0 ) ) );
		$event->setLine ( 1, $this->replaceColor ( $event->getLine ( 1 ) ) );
		$event->setLine ( 2, $this->replaceColor ( $event->getLine ( 2 ) ) );
		$event->setLine ( 3, $this->replaceColor ( $event->getLine ( 3 ) ) );
	}
	public function onJoin(PlayerJoinEvent $event) {
		$event->getPlayer ()->setRemoveFormat ( false );
	}
	public function replaceColor($text) {
		for($i = 0; $i <= 9; $i ++)
			$text = str_replace ( "&" . $i, "§" . $i, $text );
		for($i = 'a'; $i <= 'f'; $i ++)
			$text = str_replace ( "&" . $i, "§" . $i, $text );
		return $text;
	}<commit_msg>Colorful - add missing @mkdir<commit_after><?php

namespace ifteam\ColorFul;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerChatEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\block\SignChangeEvent;
use pocketmine\command\CommandSender;
use pocketmine\command\Command;
use pocketmine\utils\TextFormat;
use pocketmine\command\PluginCommand;
use pocketmine\utils\Config;

class ColorFul extends PluginBase implements Listener {
	public $m_version = 1;
	public $messages;
	public function onEnable() {
		@mkdir ( $this->getDataFolder () );
		$this->initMessage ();
		$this->registerCommand ( $this->get ( "colorTable" ), "colorful", $this->get ( "colorTable-desc" ), "/" . $this->get ( "colorTable" ) );
		
		$this->getServer ()->getPluginManager ()->registerEvents ( $this, $this );
	}
	public function onChat(PlayerChatEvent $event) {
		$event->setFormat ( $this->replaceColor ( $event->getFormat () ) );
		$event->setMessage ( $this->replaceColor ( $event->getMessage () ) );
	}
	public function onSign(SignChangeEvent $event) {
		$event->setLine ( 0, $this->replaceColor ( $event->getLine ( 0 ) ) );
		$event->setLine ( 1, $this->replaceColor ( $event->getLine ( 1 ) ) );
		$event->setLine ( 2, $this->replaceColor ( $event->getLine ( 2 ) ) );
		$event->setLine ( 3, $this->replaceColor ( $event->getLine ( 3 ) ) );
	}
	public function onJoin(PlayerJoinEvent $event) {
		$event->getPlayer ()->setRemoveFormat ( false );
	}
	public function replaceColor($text) {
		for($i = 0; $i <= 9; $i ++)
			$text = str_replace ( "&" . $i, "§" . $i, $text );
		for($i = 'a'; $i <= 'f'; $i ++)
			$text = str_replace ( "&" . $i, "§" . $i, $text );
		return $text;
	}
{'fraction_non_alphanumeric': 0.18280516431924881, 'fraction_numerical': 0.006455399061032864, 'mean_word_length': 4.445686900958466, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 60, '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': '5204319', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1152, 'n_words': 243}