mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-16 16:34:05 +00:00
Remove duplicated tiles from chunk table automatically
This commit is contained in:
parent
754e0dbb49
commit
8eb80be691
@ -21,12 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
abstract class Solid extends Block{
|
abstract class Solid extends Block{
|
||||||
|
public $isSolid = true;
|
||||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
public $isFullBlock = true;
|
||||||
parent::__construct($id, $meta, $name);
|
|
||||||
$this->isSolid = true;
|
|
||||||
$this->isFullBlock = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -237,7 +237,10 @@ abstract class BaseFullChunk implements FullChunk{
|
|||||||
|
|
||||||
public function addTile(Tile $tile){
|
public function addTile(Tile $tile){
|
||||||
$this->tiles[$tile->getID()] = $tile;
|
$this->tiles[$tile->getID()] = $tile;
|
||||||
$this->tileList[(($tile->z & 0x0f) << 12) | (($tile->x & 0x0f) << 8) | ($tile->y & 0xff)] = $tile;
|
if(isset($this->tileList[$index = (($tile->z & 0x0f) << 12) | (($tile->x & 0x0f) << 8) | ($tile->y & 0xff)]) and $this->tileList[$index] !== $tile){
|
||||||
|
$this->tileList[$index]->close();
|
||||||
|
}
|
||||||
|
$this->tileList[$index] = $tile;
|
||||||
$this->hasChanged = true;
|
$this->hasChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user