Class SimpleSafeTTeleporter
- java.lang.Object
-
- com.onarandombox.MultiverseCore.utils.SimpleSafeTTeleporter
-
- All Implemented Interfaces:
SafeTTeleporter
,Teleporter
public class SimpleSafeTTeleporter extends java.lang.Object implements SafeTTeleporter
The default-implementation ofSafeTTeleporter
.
-
-
Constructor Summary
Constructors Constructor Description SimpleSafeTTeleporter(MultiverseCore plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bukkit.Location
findPortalBlockNextTo(org.bukkit.Location l)
Finds a portal-block next to the specifiedLocation
.org.bukkit.Location
getSafeLocation(org.bukkit.entity.Entity e, MVDestination d)
Returns a safe location for the entity to spawn at.org.bukkit.Location
getSafeLocation(org.bukkit.Location l)
Gets the next safe location around the given location.org.bukkit.Location
getSafeLocation(org.bukkit.Location l, int tolerance, int radius)
Gets the next safe location around the given location.TeleportResult
safelyTeleport(org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Entity teleportee, MVDestination d)
Safely teleport the entity to the MVDestination.TeleportResult
safelyTeleport(org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Entity teleportee, org.bukkit.Location location, boolean safely)
Safely teleport the entity to the Location.TeleportResult
teleport(org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Player teleportee, MVDestination destination)
-
-
-
Constructor Detail
-
SimpleSafeTTeleporter
public SimpleSafeTTeleporter(MultiverseCore plugin)
-
-
Method Detail
-
getSafeLocation
public org.bukkit.Location getSafeLocation(org.bukkit.Location l)
Gets the next safe location around the given location.- Specified by:
getSafeLocation
in interfaceSafeTTeleporter
- Parameters:
l
- ALocation
.- Returns:
- A safe
Location
.
-
getSafeLocation
public org.bukkit.Location getSafeLocation(org.bukkit.Location l, int tolerance, int radius)
Gets the next safe location around the given location.- Specified by:
getSafeLocation
in interfaceSafeTTeleporter
- Parameters:
l
- ALocation
.tolerance
- The tolerance.radius
- The radius.- Returns:
- A safe
Location
.
-
safelyTeleport
public TeleportResult safelyTeleport(org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Entity teleportee, MVDestination d)
Safely teleport the entity to the MVDestination. This will perform checks to see if the place is safe, and if it's not, will adjust the final destination accordingly.- Specified by:
safelyTeleport
in interfaceSafeTTeleporter
- Parameters:
teleporter
- Person who performed the teleport command.teleportee
- Entity to teleportd
- Destination to teleport them to- Returns:
- true for success, false for failure
-
safelyTeleport
public TeleportResult safelyTeleport(org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Entity teleportee, org.bukkit.Location location, boolean safely)
Safely teleport the entity to the Location. This may perform checks to see if the place is safe, and if it's not, will adjust the final destination accordingly.- Specified by:
safelyTeleport
in interfaceSafeTTeleporter
- Parameters:
teleporter
- Person who issued the teleport command.teleportee
- Entity to teleport.location
- Location to teleport them to.safely
- Should the destination be checked for safety before teleport?- Returns:
- true for success, false for failure.
-
getSafeLocation
public org.bukkit.Location getSafeLocation(org.bukkit.entity.Entity e, MVDestination d)
Returns a safe location for the entity to spawn at.- Specified by:
getSafeLocation
in interfaceSafeTTeleporter
- Parameters:
e
- The entity to spawnd
- The MVDestination to take the entity to.- Returns:
- A new location to spawn the entity at.
-
findPortalBlockNextTo
public org.bukkit.Location findPortalBlockNextTo(org.bukkit.Location l)
Finds a portal-block next to the specifiedLocation
.- Specified by:
findPortalBlockNextTo
in interfaceSafeTTeleporter
- Parameters:
l
- TheLocation
- Returns:
- The next portal-block's
Location
.
-
teleport
public TeleportResult teleport(org.bukkit.command.CommandSender teleporter, org.bukkit.entity.Player teleportee, MVDestination destination)
- Specified by:
teleport
in interfaceTeleporter
-
-