mobs will spawn only in loaded chunks, entities in unloaded chunks will automatically *rip*

This commit is contained in:
GameHerobrine 2023-07-04 03:57:40 +03:00
parent bc979c2853
commit 8d1e76f84d
7 changed files with 21 additions and 12 deletions

View file

@ -19,7 +19,7 @@ class Level{
*/
public $entityList;
public $tiles, $blockUpdates, $nextSave, $players = [], $level, $mobSpawner;
private $time, $startCheck, $startTime, $server, $name, $usedChunks, $changedBlocks, $changedCount, $stopTime;
public $time, $startCheck, $startTime, $server, $name, $usedChunks, $changedBlocks, $changedCount, $stopTime;
private $generator;
public function __construct(PMFLevel $level, Config $entities, Config $tiles, Config $blockUpdates, $name){
@ -593,7 +593,7 @@ class Level{
*/
public function getBlockWithoutVector($x, $y, $z, $positionfy = true){
$b = $this->level->getBlock($x, $y, $z);
$b = $this->level->getBlock((int)$x, (int)$y, (int)$z);
return BlockAPI::get($b[0], $b[1], $positionfy ? new Position($x, $y, $z, $this) : false);
}