Class UtilTeleport
java.lang.Object
net.lewmc.essence.teleportation.tp.UtilTeleport
Essence's teleportation utility.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumUsed to communicate the type of teleportation to commands where this may be ambiguous. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcooldownRemaining(org.bukkit.entity.Player player, String type) Gets the amount of time remaining on a specific type of cooldown.booleancooldownSurpassed(org.bukkit.entity.Player player, String type) Checks if the cooldown has surpassed for a specific type of teleportation.voiddoTeleport(org.bukkit.entity.Player player, org.bukkit.Location location, int delay) Teleports a player.voiddoTeleport(org.bukkit.entity.Player player, org.bukkit.World world, double X, double Y, double Z, float yaw, float pitch, int delay) Creates a location to teleport a player, then teleports them.getTeleportType(String[] args) Determines which type of teleportation is taking place.voidsetCooldown(org.bukkit.entity.Player player, String type) Sets the cooldown for a specific type of teleportation.voidsetTeleportStatus(org.bukkit.entity.Player player, boolean teleportInFuture) Sets a player's teleport status.booleanteleportIsValid(org.bukkit.entity.Player player) Gets a player's teleport status.booleanteleportToggleCheck(org.bukkit.entity.Player requester, org.bukkit.entity.Player target) Is the teleport blocked by the teleport toggle?
-
Constructor Details
-
UtilTeleport
Constructor for the TeleportUtil class.- Parameters:
plugin- Reference to the main Essence class.
-
-
Method Details
-
cooldownSurpassed
Checks if the cooldown has surpassed for a specific type of teleportation.- Parameters:
player- Player - The player to querytype- String - The type of teleportation.- Returns:
- boolean - If the cooldown has surpassed or not.
-
setCooldown
Sets the cooldown for a specific type of teleportation.- Parameters:
player- Player - The player to set the cooldown for.type- String - The type of cooldown.
-
cooldownRemaining
Gets the amount of time remaining on a specific type of cooldown.- Parameters:
player- Player - The player to set the cooldown for.type- String - The type of cooldown.- Returns:
- int - The amount of time remaining.
-
doTeleport
public void doTeleport(org.bukkit.entity.Player player, org.bukkit.World world, double X, double Y, double Z, float yaw, float pitch, int delay) Creates a location to teleport a player, then teleports them.- Parameters:
player- Player - The player to teleport.world- World - The world to teleport them to.X- double - The X coordinate.Y- double - The Y coordinate.Z- double - The Z coordinate.yaw- float - The yaw.pitch- float - The pitchdelay- int - The time to wait before teleporting.
-
doTeleport
public void doTeleport(org.bukkit.entity.Player player, org.bukkit.Location location, int delay) Teleports a player.- Parameters:
player- Player - The player to teleport.location- Location - The location to teleport them to,delay- int - The amount of time to wait before teleporting.
-
getTeleportType
Determines which type of teleportation is taking place.- Parameters:
args- String[] - arguments from a command.- Returns:
- Type - The teleportation type (instanceof TeleportUtil.Type)
-
setTeleportStatus
public void setTeleportStatus(org.bukkit.entity.Player player, boolean teleportInFuture) Sets a player's teleport status.- Parameters:
player- Player - The player to teleport.teleportInFuture- boolean - Is the teleport happening in the future?
-
teleportIsValid
public boolean teleportIsValid(org.bukkit.entity.Player player) Gets a player's teleport status.- Parameters:
player- Player - The player to teleport.- Returns:
- boolean - Is valid?
-
teleportToggleCheck
public boolean teleportToggleCheck(org.bukkit.entity.Player requester, org.bukkit.entity.Player target) Is the teleport blocked by the teleport toggle?- Parameters:
requester- The player requesting the teleport.target- The target of the teleport.- Returns:
- true - Teleport can proceed, false - Teleport should be blocked.
-