Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Commit a64eeb0

Browse files
committed
Fix BlockReGeneratorTask
1 parent cd0b208 commit a64eeb0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/VectorNetworkProject/TheMix/task/BlockReGeneratorTask.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use pocketmine\block\Block;
1212
use pocketmine\scheduler\Task;
13+
use VectorNetworkProject\TheMix\TheMix;
1314

1415
class BlockReGeneratorTask extends Task
1516
{
@@ -26,6 +27,10 @@ public function __construct(Block $block)
2627
*/
2728
public function onRun(int $currentTick)
2829
{
30+
if (TheMix::getInstance()->getServer()->getLevelByName($this->getBlock()->getLevel()->getName())->getId() === $this->getBlock()->getLevel()->getId()) {
31+
$this->getHandler()->cancel();
32+
return;
33+
}
2934
$this->getBlock()->getLevel()->setBlock($this->getBlock()->asVector3(), $this->block);
3035
}
3136

0 commit comments

Comments
 (0)