small changes to entity ai(again =/)

This commit is contained in:
GameHerobrine 2022-11-11 20:13:08 +03:00
parent c29d8dab9d
commit 978447cdbb
9 changed files with 44 additions and 41 deletions

View file

@ -38,6 +38,15 @@ class Utils{
}
return $id;
}
public static function getSign($v){
return $v > 0 ? 1 : ($v < 0 ? -1 : 0);
}
public static function clampDegrees($v){
return floor(($v % 360 + 360) % 360);
}
public static function hasEmoji($s){
return preg_match(Utils::emojiRegex, $s, $matches);
}