diff --git a/src/tedo0627/redstonecircuit/block/power/BlockStonePressurePlate.php b/src/tedo0627/redstonecircuit/block/power/BlockStonePressurePlate.php index 55483e3..bbd8ec4 100644 --- a/src/tedo0627/redstonecircuit/block/power/BlockStonePressurePlate.php +++ b/src/tedo0627/redstonecircuit/block/power/BlockStonePressurePlate.php @@ -59,6 +59,8 @@ public function onScheduledUpdate(): void { } public function onEntityInside(Entity $entity): bool { + if ($entity instanceof Player && $entity->isSpectator()) return true; + $entities = $this->getPosition()->getWorld()->getNearbyEntities($this->getHitCollision()); $entities = array_filter($entities, fn($entity) => $entity instanceof Living); if (count($entities) <= 0) return true; diff --git a/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateHeavy.php b/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateHeavy.php index f2113d0..c2e258a 100644 --- a/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateHeavy.php +++ b/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateHeavy.php @@ -64,6 +64,8 @@ public function onScheduledUpdate(): void { } public function onEntityInside(Entity $entity): bool { + if ($entity instanceof Player && $entity->isSpectator()) return true; + $entities = $this->getPosition()->getWorld()->getNearbyEntities($this->getHitCollision()); $count = count($entities); if ($count <= 0) return true; diff --git a/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateLight.php b/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateLight.php index 41ea3cc..7b6321e 100644 --- a/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateLight.php +++ b/src/tedo0627/redstonecircuit/block/power/BlockWeightedPressurePlateLight.php @@ -64,6 +64,8 @@ public function onScheduledUpdate(): void { } public function onEntityInside(Entity $entity): bool { + if ($entity instanceof Player && $entity->isSpectator()) return true; + $entities = $this->getPosition()->getWorld()->getNearbyEntities($this->getHitCollision()); $count = count($entities); if ($count <= 0) return true; diff --git a/src/tedo0627/redstonecircuit/block/power/BlockWoodenPressurePlate.php b/src/tedo0627/redstonecircuit/block/power/BlockWoodenPressurePlate.php index f7fbe9d..e17428f 100644 --- a/src/tedo0627/redstonecircuit/block/power/BlockWoodenPressurePlate.php +++ b/src/tedo0627/redstonecircuit/block/power/BlockWoodenPressurePlate.php @@ -57,6 +57,8 @@ public function onScheduledUpdate(): void { } public function onEntityInside(Entity $entity): bool { + if ($entity instanceof Player && $entity->isSpectator()) return true; + $entities = $this->getPosition()->getWorld()->getNearbyEntities($this->getHitCollision()); if (count($entities) <= 0) return true;