Skip to content
This repository was archived by the owner on Dec 12, 2022. It is now read-only.

Commit 0b48c4e

Browse files
committed
feat: block bug fixed
1 parent a829912 commit 0b48c4e

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/jossc/volcano/entity/CustomFallingWoolBlock.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
namespace jossc\volcano\entity;
44

55
use pocketmine\block\Block;
6+
use pocketmine\block\BlockFactory;
67
use pocketmine\entity\object\FallingBlock;
78

89
class CustomFallingWoolBlock extends FallingBlock {
910

10-
protected function initEntity(): void
11-
{
12-
$this->block = Block::get(Block::WOOL, rand(0, 15));
11+
protected function initEntity(): void {
12+
$this->block = BlockFactory::get(Block::WOOL, rand(0, 15));
13+
14+
$this->propertyManager->setInt(self::DATA_VARIANT, $this->block->getRuntimeId());
15+
1316
$this->setForceMovementUpdate(true);
1417
$this->setCanSaveWithChunk(false);
1518
}
@@ -18,8 +21,7 @@ protected function initEntity(): void
1821
* @param int $tickDiff
1922
* @return bool
2023
*/
21-
public function entityBaseTick(int $tickDiff = 1): bool
22-
{
24+
public function entityBaseTick(int $tickDiff = 1): bool {
2325
if ($this->isClosed()) {
2426
return false;
2527
}

0 commit comments

Comments
 (0)