Package net.pottercraft.ollivanders2
Class Ollivanders2TeleportActions
java.lang.Object
net.pottercraft.ollivanders2.Ollivanders2TeleportActions
With MC 1.14, triggering PlayerTeleportEvents from other events is no longer thread-safe. Need to create a queue of
teleport events like we use for things like spell projectiles and effects.
- Since:
- 2.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA teleport action -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTeleportEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location from, @NotNull org.bukkit.Location to) Add a teleport action to the list.voidaddTeleportEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location from, @NotNull org.bukkit.Location to, boolean explosionOnTeleport) Add a teleport action to the list.Get all the teleport events.voidremoveTeleportEvent(Ollivanders2TeleportActions.O2TeleportAction teleportAction) Remove a teleport action from the list.
-
Constructor Details
-
Ollivanders2TeleportActions
Constructor- Parameters:
plugin- a callback to the MC plugin
-
-
Method Details
-
getTeleportActions
Get all the teleport events.- Returns:
- a list of the pending teleport events
-
addTeleportEvent
public void addTeleportEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location from, @NotNull @NotNull org.bukkit.Location to) Add a teleport action to the list.- Parameters:
player- the player teleportingfrom- the location they are teleporting fromto- the location they are teleporting to
-
addTeleportEvent
public void addTeleportEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location from, @NotNull @NotNull org.bukkit.Location to, boolean explosionOnTeleport) Add a teleport action to the list.- Parameters:
player- the player teleportingfrom- the location they are teleporting fromto- the location they are teleporting toexplosionOnTeleport- should there be an explosion effect on teleport
-
removeTeleportEvent
public void removeTeleportEvent(@NotNull Ollivanders2TeleportActions.O2TeleportAction teleportAction) Remove a teleport action from the list.- Parameters:
teleportAction- the teleport action to remove
-