Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.TravelAgent Interface Reference

Public Member Functions

TravelAgent setSearchRadius (int radius)
 
int getSearchRadius ()
 
TravelAgent setCreationRadius (int radius)
 
int getCreationRadius ()
 
boolean getCanCreatePortal ()
 
void setCanCreatePortal (boolean create)
 
Location findOrCreate (Location location)
 
Location findPortal (Location location)
 
boolean createPortal (Location location)
 

Detailed Description

The Travel Agent handles the creation and the research of Nether and End portals when Entities try to use one.

It is used in org.bukkit.event.entity.EntityPortalEvent and in org.bukkit.event.player.PlayerPortalEvent to help developers reproduce and/or modify Vanilla behaviour.

Definition at line 11 of file TravelAgent.java.

Member Function Documentation

boolean org.bukkit.TravelAgent.createPortal ( Location  location)

Attempt to create a portal near the given location.

In the case of a Nether portal teleportation, this will attempt to create a Nether portal.

In the case of an Ender portal teleportation, this will (re-)create the obsidian platform and clean blocks above it.

Parameters
locationthe desired location of the portal
Returns
true if a portal was successfully created
Location org.bukkit.TravelAgent.findOrCreate ( Location  location)

Attempt to find a portal near the given location, if a portal is not found it will attempt to create one.

Parameters
locationthe location where the search for a portal should begin
Returns
the location of a portal which has been found or returns the location passed to the method if unsuccessful
See also
createPortal(Location)
Location org.bukkit.TravelAgent.findPortal ( Location  location)

Attempt to find a portal near the given location.

Parameters
locationthe desired location of the portal
Returns
the location of the nearest portal to the location
boolean org.bukkit.TravelAgent.getCanCreatePortal ( )

Returns whether the TravelAgent will attempt to create a destination portal or not.

Returns
whether the TravelAgent should create a destination portal or not
int org.bukkit.TravelAgent.getCreationRadius ( )

Gets the maximum radius from the given location to create a portal.

Returns
the currently set creation radius
int org.bukkit.TravelAgent.getSearchRadius ( )

Gets the search radius value for finding an available portal.

Returns
the currently set search radius
void org.bukkit.TravelAgent.setCanCreatePortal ( boolean  create)

Sets whether the TravelAgent should attempt to create a destination portal or not.

Parameters
createSets whether the TravelAgent should create a destination portal or not
TravelAgent org.bukkit.TravelAgent.setCreationRadius ( int  radius)

Sets the maximum radius from the given location to create a portal.

Parameters
radiusthe radius in which to create a portal from the location
Returns
this travel agent
TravelAgent org.bukkit.TravelAgent.setSearchRadius ( int  radius)

Set the Block radius to search in for available portals.

Parameters
radiusthe radius in which to search for a portal from the location
Returns
this travel agent

The documentation for this interface was generated from the following file: