Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 77011cc

Browse files
committed
真紅の根、歪んだ根 を追加
1 parent f53b377 commit 77011cc

File tree

4 files changed

+88
-1
lines changed

4 files changed

+88
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ PocketMine-MP本体を変更しないのが原則なので(悪い意味で)素
156156
- [x] しだれツタ
157157
- [x] ねじれツタ
158158
- [x] 真紅のナイリウム / 歪んだナイリウム
159-
- [ ] 真紅の根 / 歪んだ根
159+
- [x] 真紅の根 / 歪んだ根
160160
- [x] ネザースプラウト
161161
- [x] ソウルソイル
162162
- [x] 玄武岩

src/feature/v1_16/CrimsonRoots.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace NeiroNetwork\ExperimentalFeatures\feature\v1_16;
6+
7+
use NeiroNetwork\ExperimentalFeatures\feature\Feature;
8+
use NeiroNetwork\ExperimentalFeatures\feature\interfaces\IBlock;
9+
use NeiroNetwork\ExperimentalFeatures\feature\v1_16\block\Roots;
10+
use pocketmine\block\Block;
11+
use pocketmine\block\BlockBreakInfo;
12+
13+
class CrimsonRoots extends Feature implements IBlock{
14+
15+
public function stringId() : string{
16+
return "crimson_roots";
17+
}
18+
19+
public function block() : Block{
20+
return new Roots($this->blockId(), $this->displayName(), BlockBreakInfo::instant());
21+
}
22+
}

src/feature/v1_16/WarpedRoots.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace NeiroNetwork\ExperimentalFeatures\feature\v1_16;
6+
7+
use NeiroNetwork\ExperimentalFeatures\feature\Feature;
8+
use NeiroNetwork\ExperimentalFeatures\feature\interfaces\IBlock;
9+
use NeiroNetwork\ExperimentalFeatures\feature\v1_16\block\Roots;
10+
use pocketmine\block\Block;
11+
use pocketmine\block\BlockBreakInfo;
12+
13+
class WarpedRoots extends Feature implements IBlock{
14+
15+
public function stringId() : string{
16+
return "warped_roots";
17+
}
18+
19+
public function block() : Block{
20+
return new Roots($this->blockId(), $this->displayName(), BlockBreakInfo::instant());
21+
}
22+
}

src/feature/v1_16/block/Roots.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace NeiroNetwork\ExperimentalFeatures\feature\v1_16\block;
6+
7+
use pocketmine\block\Block;
8+
use pocketmine\block\Flower;
9+
use pocketmine\item\Item;
10+
use pocketmine\math\Facing;
11+
use pocketmine\math\Vector3;
12+
use pocketmine\player\Player;
13+
use pocketmine\world\BlockTransaction;
14+
15+
// HACK: 植木鉢に入れられるのでFlowerを継承する
16+
class Roots extends Flower{
17+
18+
public function canBeReplaced() : bool{
19+
return true;
20+
}
21+
22+
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
23+
// TODO: 置ける場所をより正確にする
24+
if(!$blockReplace->getSide(Facing::DOWN)->isTransparent()){
25+
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
26+
}
27+
return false;
28+
}
29+
30+
public function onNearbyBlockChange() : void{
31+
if($this->getSide(Facing::DOWN)->isTransparent()){
32+
$this->position->getWorld()->useBreakOn($this->position);
33+
}
34+
}
35+
36+
public function getFlameEncouragement() : int{
37+
return parent::getFlameEncouragement(); // TODO: Change the autogenerated stub
38+
}
39+
40+
public function getFlammability() : int{
41+
return 0;
42+
}
43+
}

0 commit comments

Comments
 (0)