added ability to disable emojis on signs

This commit is contained in:
GameHerobrine 2025-05-25 20:24:35 +03:00
parent 69d3321e16
commit ccdea98d28
6 changed files with 21 additions and 3 deletions

View file

@ -6,6 +6,7 @@ class Player{
public static $experimentalHotbar = false;
public static $allowDroppingSingleItems = true;
public static $disableEmojisInChat = true;
/** @var Config */
public $data;
/** @var Entity */
@ -2502,7 +2503,7 @@ class Player{
$this->server->api->console->run(substr($message, 1), $this);
}else{
$data = ["player" => $this, "message" => $message];
if(Utils::hasEmoji($data["message"])){
if(Player::$disableEmojisInChat && Utils::hasEmoji($data["message"])){
$this->sendChat("Your message contains illegal characters");
break;
}
@ -2712,6 +2713,7 @@ class Player{
if($d["id"] !== TILE_SIGN){
$t->spawn($this);
}else{
$t->setText($d["Text1"], $d["Text2"], $d["Text3"], $d["Text4"]);
}
}