Class TeleportLogic
java.lang.Object
us.talabrek.ultimateskyblock.player.TeleportLogic
- All Implemented Interfaces:
org.bukkit.event.Listener
Responsible for teleporting (and cancelling teleporting) of players.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
homeTeleport
(@NotNull org.bukkit.entity.Player player, boolean force) Teleport the givenPlayer
to his island home.void
onPlayerMove
(org.bukkit.event.player.PlayerMoveEvent e) void
safeTeleport
(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location targetLocation, boolean force) Teleport the givenPlayer
to the givenLocation
, loading theChunk
before teleporting and with the configured teleport delay if applicable.void
spawnTeleport
(@NotNull org.bukkit.entity.Player player, boolean force) Teleport the givenPlayer
to the spawn in the island world, loading theChunk
before teleporting and with the configured teleport delay if applicable.void
warpTeleport
(@NotNull org.bukkit.entity.Player player, @Nullable PlayerInfo playerInfo, boolean force) Teleport the givenPlayer
to the warp location for the givenPlayerInfo
.
-
Constructor Details
-
TeleportLogic
-
-
Method Details
-
homeTeleport
public void homeTeleport(@NotNull @NotNull org.bukkit.entity.Player player, boolean force) Teleport the givenPlayer
to his island home.- Parameters:
player
- Player to teleportforce
- True to override teleport delay, false otherwise.
-
safeTeleport
public void safeTeleport(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location targetLocation, boolean force) Teleport the givenPlayer
to the givenLocation
, loading theChunk
before teleporting and with the configured teleport delay if applicable.- Parameters:
player
- Player to teleport.targetLocation
- Location to teleport the player to.force
- True to override teleport delay, false otherwise.
-
spawnTeleport
public void spawnTeleport(@NotNull @NotNull org.bukkit.entity.Player player, boolean force) Teleport the givenPlayer
to the spawn in the island world, loading theChunk
before teleporting and with the configured teleport delay if applicable.- Parameters:
player
- Player to teleport.force
- True to override teleport delay, false otherwise.
-
warpTeleport
public void warpTeleport(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable PlayerInfo playerInfo, boolean force) Teleport the givenPlayer
to the warp location for the givenPlayerInfo
.- Parameters:
player
- Player to teleport.playerInfo
- PlayerInfo to lookup the target warp location.force
- True to override teleport delay, false otherwise.
-
onPlayerMove
public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent e)
-