mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Chunk: do not close preexisting tiles in addTile()
if it's desired to actually replace a tile, the old tile should be explicitly removed and closed first.
This commit is contained in:
parent
b2e806e2fa
commit
bdce781c6d
@ -229,7 +229,7 @@ class Chunk{
|
||||
|
||||
$pos = $tile->getPos();
|
||||
if(isset($this->tiles[$index = Chunk::blockHash($pos->x, $pos->y, $pos->z)]) and $this->tiles[$index] !== $tile){
|
||||
$this->tiles[$index]->close();
|
||||
throw new \InvalidArgumentException("Another tile is already at this location");
|
||||
}
|
||||
$this->tiles[$index] = $tile;
|
||||
$this->dirtyFlags |= self::DIRTY_FLAG_TILES;
|
||||
|
Loading…
x
Reference in New Issue
Block a user