mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Level: clone Block object passed to setBlock() if set successfully
closes #2042
This commit is contained in:
parent
7f6b8ad7c2
commit
7fcc538a75
@ -1519,6 +1519,8 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pos = $this->temporalPosition->setComponents($pos->x, $pos->y, $pos->z);
|
||||
}
|
||||
|
||||
$block = clone $block;
|
||||
|
||||
$block->position($pos);
|
||||
$block->clearCaches();
|
||||
|
||||
@ -1535,7 +1537,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$this->changedBlocks[$chunkHash] = [];
|
||||
}
|
||||
|
||||
$this->changedBlocks[$chunkHash][$blockHash] = clone $block;
|
||||
$this->changedBlocks[$chunkHash][$blockHash] = $block;
|
||||
}
|
||||
|
||||
foreach($this->getChunkLoaders($pos->x >> 4, $pos->z >> 4) as $loader){
|
||||
|
Loading…
x
Reference in New Issue
Block a user