NetherPortalBuilder 5.46.0
Builds the 2x3 portal an entity arrives through when no linked portal exists, like vanilla (simplified):
- the closest spot within 16 blocks (searching rings outwards) with a solid floor under the portal and room to step out on one side;
- otherwise a portal standing on a small obsidian platform at the arrival position, with the space around cleared.
Constants
SEARCH_RADIUS
php
public const SEARCH_RADIUS = 16Methods
build()
php
public static function build(\pocketmine\world\World $world, int $x, int $y, int $z, int $axis, bool $platform) : \pocketmine\world\dimension\NetherPortalShapeBuilds a lit 2x3 portal (4x5 obsidian frame) with its bottom-left interior block at the given position.
clampY()
php
public static function clampY(\pocketmine\world\World $world, int $y) : intClamps an arrival position to where a portal may be built in the given world.
create()
php
public static function create(\pocketmine\world\World $world, \pocketmine\math\Vector3 $target) : \pocketmine\world\dimension\NetherPortalShapeBuilds a new portal as close as possible to the target and records it. The chunks within SEARCH_RADIUS blocks of the target must be loaded.
findSpot()
php
public static function findSpot(\pocketmine\world\World $world, \pocketmine\math\Vector3 $target) : ?arrayFinds a spot for a new portal near the target position, or returns null if there is none within the search radius.
