API
API documentation for the Portals plugin.
Edit on GitHubJavadocs for the API can be found here.
Getting Started
PortalProvider
The PortalProvider is the main interface for interacting with portals.
You can retrieve an instance using:
PortalProvider provider = PortalProvider.provider();The provider offers methods to manage portals:
// Create a new portal
Portal portal = provider.createPortal("my-portal", boundingBox);
// Delete a portal
provider.deletePortal(portal);
// Get a portal by name
Optional<Portal> portal = provider.getPortal("my-portal");
// Get all portals
Stream<Portal> portals = provider.getPortals();PortalConfig
The PortalConfig provides a view of the plugin configuration.
You can retrieve an instance using:
PortalConfig config = PortalConfig.config();BoundingBox
A BoundingBox defines the physical region of a portal.
You can create one using:
BoundingBox box = BoundingBox.of(world, minPosition, maxPosition);SelectionProvider
The SelectionProvider provides selection functionality for players (e.g., WorldEdit selections).
It can also be extended to provide your own custom selection provider.
An instance can be obtained via the Bukkit services manager if one is available:
SelectionProvider selection = Bukkit.getServicesManager().load(SelectionProvider.class);
if (selection != null) {
// Selection provider is available (e.g., WorldEdit is installed)
Optional<BoundingBox> box = selection.getSelection(player);
}Last updated on