Skip to content

Commit b176c8c

Browse files
committed
Flowalbeなブロックと当たり判定が存在しないブロックは更新されるように変更
1 parent 1901ff7 commit b176c8c

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ PocketMine-MPに存在する以下の機能を無効化します
1111
- ブロックのテレポート
1212
- ドラゴンエッグ
1313
- ブロックの更新
14-
- TNTが地形を破壊したとき
15-
- プレイヤーがブロックを設置/破壊したとき
14+
- TNTが地形を破壊したときに周囲のブロックの更新を行わない
15+
- プレイヤーがブロックを設置/破壊したときに周囲のブロックの更新を行わない
16+
- ただしFlowableなブロックと当たり判定が存在しないブロックは更新される
1617
- など…
1718
- 葉っぱの自動破壊
1819
- 構造物の成長

plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: NoWorldCorruption
2-
version: 1.0.0
2+
version: 1.0.1
33
main: NeiroNetwork\NoWorldCorruption\Main
44
api: 4.0.0

src/NeiroNetwork/NoWorldCorruption/Main.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace NeiroNetwork\NoWorldCorruption;
66

7+
use pocketmine\block\Flowable;
78
use pocketmine\event\block\BlockBurnEvent;
89
use pocketmine\event\block\BlockFormEvent;
910
use pocketmine\event\block\BlockGrowEvent;
@@ -14,8 +15,6 @@
1415
use pocketmine\event\block\StructureGrowEvent;
1516
use pocketmine\event\entity\EntityTrampleFarmlandEvent;
1617
use pocketmine\event\Listener;
17-
use pocketmine\event\player\PlayerInteractEvent;
18-
use pocketmine\event\server\DataPacketReceiveEvent;
1918
use pocketmine\plugin\PluginBase;
2019

2120
class Main extends PluginBase implements Listener{
@@ -45,7 +44,10 @@ public function onBlockTeleport(BlockTeleportEvent $event){
4544
}
4645

4746
public function onBlockUpdate(BlockUpdateEvent $event){
48-
$event->cancel();
47+
$block = $event->getBlock();
48+
if(!$block instanceof Flowable && !empty($block->getCollisionBoxes())){
49+
$event->cancel();
50+
}
4951
}
5052

5153
public function onLeavesDecay(LeavesDecayEvent $event){

0 commit comments

Comments
 (0)