mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Mostly phase out EmptySubChunk
copy-on-write and zero-layer SubChunk objects are much easier to manage and have less cognitive overhead. obviously, the goal is to get rid of EmptySubChunk completely, but right now it does still serve a purpose (filling in dummy values for reading out-of-bounds on chunks), and that's a problem that takes a little more work to fix.
This commit is contained in:
@@ -64,7 +64,6 @@ use pocketmine\utils\Limits;
|
||||
use pocketmine\utils\ReversePriorityQueue;
|
||||
use pocketmine\world\biome\Biome;
|
||||
use pocketmine\world\format\Chunk;
|
||||
use pocketmine\world\format\EmptySubChunk;
|
||||
use pocketmine\world\format\io\exception\CorruptedChunkException;
|
||||
use pocketmine\world\format\io\WritableWorldProvider;
|
||||
use pocketmine\world\generator\Generator;
|
||||
@@ -983,7 +982,7 @@ class World implements ChunkManager{
|
||||
|
||||
|
||||
foreach($chunk->getSubChunks() as $Y => $subChunk){
|
||||
if(!($subChunk instanceof EmptySubChunk)){
|
||||
if(!$subChunk->isEmptyFast()){
|
||||
$k = mt_rand(0, 0xfffffffff); //36 bits
|
||||
for($i = 0; $i < 3; ++$i){
|
||||
$x = $k & 0x0f;
|
||||
|
Reference in New Issue
Block a user