mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
mobs will spawn only in loaded chunks, entities in unloaded chunks will automatically *rip*
This commit is contained in:
parent
bc979c2853
commit
8d1e76f84d
7 changed files with 21 additions and 12 deletions
|
|
@ -38,8 +38,9 @@ class MobSpawner{
|
|||
}else{
|
||||
return false;
|
||||
}
|
||||
$x = mt_rand(0,255);
|
||||
$z = mt_rand(0,255);
|
||||
$chunk = explode(".", array_rand($this->level->usedChunks, 1));
|
||||
$x = $chunk[0] * 16;
|
||||
$z = $chunk[1] * 16;
|
||||
$y = $this->getSafeY($x, $z, $grassOnly, $type >= 32 && $type <= 36 && $type != 35);
|
||||
if(!$y || $y < 0){
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue