mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 03:47:16 +00:00
Add block-break check for spectator mode, fixes players in spectator able to break blocks when adventure settings are not set correctly
This commit is contained in:
parent
ad88ca09bd
commit
5eab956da6
@ -1499,7 +1499,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($player !== null){
|
||||
$ev = new BlockBreakEvent($player, $target, $item, ($player->isCreative() or $player->allowInstaBreak()));
|
||||
|
||||
if($player->isSurvival() and $item instanceof Item and !$target->isBreakable($item)){
|
||||
if(($player->isSurvival() and $item instanceof Item and !$target->isBreakable($item)) or $player->isSpectator()){
|
||||
$ev->setCancelled();
|
||||
}elseif(!$player->isOp() and ($distance = $this->server->getSpawnRadius()) > -1){
|
||||
$t = new Vector2($target->x, $target->z);
|
||||
|
Loading…
x
Reference in New Issue
Block a user