Skip to content

Commit ab90923

Browse files
committed
fix #77 by checking if the block is a solid
1 parent 9dd0b1d commit ab90923

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ description: A powerful core for SkyBlock servers
33
author: GiantQuartz
44
website: twitter.com/GiantQuartz
55
main: room17\SkyBlock\SkyBlock
6-
version: 2.1.2
6+
version: 2.1.3
77
api: [3.0.0]

src/room17/SkyBlock/SkyBlockListener.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
namespace room17\SkyBlock;
1818

19+
use pocketmine\block\Solid;
1920
use pocketmine\event\block\BlockBreakEvent;
2021
use pocketmine\event\block\BlockPlaceEvent;
2122
use pocketmine\event\entity\EntityDamageByEntityEvent;
@@ -97,7 +98,7 @@ public function onBreak(BlockBreakEvent $event): void {
9798
if(!$isle->canInteract($session)) {
9899
$session->sendTranslatedPopup("MUST_ME_MEMBER");
99100
$event->setCancelled();
100-
} elseif(!$event->isCancelled()) {
101+
} elseif(!($event->isCancelled()) and $event->getBlock() instanceof Solid) {
101102
$isle->destroyBlock();
102103
}
103104
}
@@ -114,7 +115,7 @@ public function onPlace(BlockPlaceEvent $event): void {
114115
if(!$isle->canInteract($session)) {
115116
$session->sendTranslatedPopup("MUST_ME_MEMBER");
116117
$event->setCancelled();
117-
} elseif(!$event->isCancelled()) {
118+
} elseif(!($event->isCancelled()) and $event->getBlock() instanceof Solid) {
118119
$isle->addBlock();
119120
}
120121
}

0 commit comments

Comments
 (0)