Do not blanket-ban all inventory transactions in spectator mode, fixes #2627

instead, we cancel the appropriate events before they are called, so that plugins can uncancel them if they choose.
This commit is contained in:
Dylan K. Taylor
2020-05-31 16:32:06 +01:00
parent 3f07f06874
commit 42e14f749e
3 changed files with 6 additions and 11 deletions

View File

@ -83,7 +83,7 @@ class Bow extends Tool{
}
$ev = new EntityShootBowEvent($player, $this, $entity, $baseForce * 3);
if($baseForce < 0.1 or $diff < 5){
if($baseForce < 0.1 or $diff < 5 or $player->isSpectator()){
$ev->setCancelled();
}