PressurePlate: destroy self when no support is present

This commit is contained in:
Dylan K. Taylor
2023-01-12 19:36:47 +00:00
parent 2f3fcef97c
commit d295e1be54

View File

@ -55,5 +55,11 @@ abstract class PressurePlate extends Transparent{
return !$block->getSupportType(Facing::UP)->equals(SupportType::NONE()); return !$block->getSupportType(Facing::UP)->equals(SupportType::NONE());
} }
public function onNearbyBlockChange() : void{
if(!$this->canBeSupportedBy($this->getSide(Facing::DOWN))){
$this->position->getWorld()->useBreakOn($this->position);
}
}
//TODO //TODO
} }