122 $world = $this->position->getWorld();
124 $intersectionAABB = $this->getActivationBox();
125 $activatingEntities = $this->filterIrrelevantEntities($world->getNearbyEntities($intersectionAABB));
130 if(count($activatingEntities) > 0 || $this->hasOutputSignal()){
131 [$newState, $pressedChange] = $this->calculatePlateState($activatingEntities);
134 if(PressurePlateUpdateEvent::hasHandlers()){
137 $newState = $ev->isCancelled() ? null : $ev->getNewState();
139 if($newState !==
null){
140 $world->setBlock($this->position, $newState);
141 if($pressedChange !==
null){
142 $world->addSound($this->position, $pressedChange ?
148 if($pressedChange ?? $this->hasOutputSignal()){
149 $world->scheduleDelayedBlockUpdate($this->position, $this->deactivationDelayTicks);