Skip to content

v0.2.0

Compare
Choose a tag to compare
@Muqsit Muqsit released this 24 Jan 10:04
· 16 commits to master since this release
  • Fixed bug: Portals are wrongfully destroyed on any neighbouring block update
  • Simplified portal creation and destruction logic
  • Added PlayerCreatePortalEvent::$transaction property to track changed blocks
    This is useful for grief prevention plugins and the likes, to perform checks for whether a portal intersects a protected region:
    /** @var PlayerCreatePortalEvent $event */
    $positions = [];
    foreach($event->transaction->getBlocks() as [$x, $y, $z, $block]){
    	$positions[] = new Vector3($x, $y, $z);
    }
    $min = Vector3::minComponents(...$positions);
    $max = Vector3::maxComponents(...$positions);
    if(/* min-max intersects a protected region */){
    	$event->cancel();
    }