PocketMine-MP/src/world/format/SubChunkInterface.php
Dylan K. Taylor 01f8116cdd Fix some of the implicit immutability issues of EmptySubChunk
it's useful to have an immutable stub around for the sake of feeding back dummy read values, but for write values it has to barf instead of being quiet.
There's still some issues with LightArray which I don't currently have a solution for, but I'm thinking about separating light storage from chunks anyway.
2020-09-07 14:43:26 +01:00

54 lines
1.6 KiB
PHP

<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\world\format;
interface SubChunkInterface{
/**
* Returns whether this subchunk contains any non-air blocks.
* This function will do a slow check, usually by garbage collecting first.
* This is typically useful for disk saving.
*/
public function isEmptyAuthoritative() : bool;
/**
* Returns a non-authoritative bool to indicate whether the chunk contains any blocks.
* This may report non-empty erroneously if the chunk has been modified and not garbage-collected.
*/
public function isEmptyFast() : bool;
public function getFullBlock(int $x, int $y, int $z) : int;
/**
* @return PalettedBlockArray[]
*/
public function getBlockLayers() : array;
public function getHighestBlockAt(int $x, int $z) : int;
public function getBlockSkyLightArray() : LightArray;
public function getBlockLightArray() : LightArray;
}