Merge branch 'stable' into next-minor

# Conflicts:
#	src/pocketmine/Player.php
#	src/pocketmine/block/SnowLayer.php
This commit is contained in:
Dylan K. Taylor
2020-06-01 13:42:59 +01:00
15 changed files with 93 additions and 38 deletions

View File

@ -1858,7 +1858,7 @@ class Level implements ChunkManager, Metadatable{
if($player !== null){
$ev = new PlayerInteractEvent($player, $item, $blockClicked, $clickVector, $face, PlayerInteractEvent::RIGHT_CLICK_BLOCK);
if($this->checkSpawnProtection($player, $blockClicked)){
if($this->checkSpawnProtection($player, $blockClicked) or $player->isSpectator()){
$ev->setCancelled(); //set it to cancelled so plugins can bypass this
}
@ -1902,7 +1902,7 @@ class Level implements ChunkManager, Metadatable{
if($player !== null){
$ev = new BlockPlaceEvent($player, $hand, $blockReplace, $blockClicked, $item);
if($this->checkSpawnProtection($player, $blockReplace)){
if($this->checkSpawnProtection($player, $blockReplace) or $player->isSpectator()){
$ev->setCancelled();
}