Interface PortalType
- All Superinterfaces:
DefaultedRegistryValue
entities
one place to another.-
Method Summary
Modifier and TypeMethodDescriptionfindPortal
(ServerLocation location) boolean
generatePortal
(ServerLocation location, Axis axis) Generates the portal at thelocation
.boolean
teleport
(Entity entity, ServerLocation destination, boolean generateDestinationPortal) Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
generatePortal
Generates the portal at thelocation
.It is left up to the discretion of the plugin developer on how this is implemented. Portals come in all shapes and sizes or none at all.
The location and axis are meant to be hints and should not be considered to be the exact final location/orientation of the resulting portal.
- Parameters:
location
- The locationaxis
- The axis- Returns:
- true if a portal could be generated
-
findPortal
Finds aPortal
from alocation
.It is left up to the discretion of the plugin developer on how this is implemented. In vanilla minecraft, portals are calculated on-demand and therefore this may never return an actual value.
The location is meant to be a hint and no expectation should be made that the
Portal
will be exactly at the location.- Parameters:
location
- The location- Returns:
- The portal or
Optional.empty()
if not found
-
teleport
Teleports anEntity
through thisportal
.The location is meant to be a hint and no expectation should be made that the portal will be exactly at the location.
No assumption should be made that the generation of the destination portal will match the original portal, this is left up to the plugin dev to decide.
- Parameters:
entity
- The entitydestination
- The destinationgenerateDestinationPortal
- True if the portal should generate a destination one- Returns:
- True if teleport successful, false if not
-