mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Entity collisions, bounding boxes for entites and blocks
This commit is contained in:
parent
9154c0fc3d
commit
1448fd21b9
19 changed files with 265 additions and 118 deletions
|
|
@ -38,8 +38,6 @@ class Utils{
|
|||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
||||
public static function hasEmoji($s){
|
||||
return preg_match(Utils::emojiRegex, $s, $matches);
|
||||
}
|
||||
|
|
@ -50,7 +48,25 @@ class Utils{
|
|||
return sha1(strtolower($variable));
|
||||
}
|
||||
}
|
||||
|
||||
public function xrange($start, $limit, $step = 1) {
|
||||
if ($start <= $limit) {
|
||||
if ($step <= 0) {
|
||||
throw new LogicException('Step must be positive');
|
||||
}
|
||||
|
||||
for ($i = $start; $i <= $limit; $i += $step) {
|
||||
yield $i;
|
||||
}
|
||||
} else {
|
||||
if ($step >= 0) {
|
||||
throw new LogicException('Step must be negative');
|
||||
}
|
||||
|
||||
for ($i = $start; $i >= $limit; $i += $step) {
|
||||
yield $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
public static function getUniqueID($raw = false, $extra = ""){
|
||||
$machine = php_uname("a");
|
||||
$machine .= file_exists("/proc/cpuinfo") ? file_get_contents("/proc/cpuinfo") : "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue