Class Ollivanders2TeleportActions

java.lang.Object
net.pottercraft.ollivanders2.Ollivanders2TeleportActions

public class Ollivanders2TeleportActions extends Object
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
  • Constructor Details

    • Ollivanders2TeleportActions

      public Ollivanders2TeleportActions(@NotNull @NotNull Ollivanders2 plugin)
      Constructor
      Parameters:
      plugin - a callback to the MC plugin
  • Method Details

    • getTeleportActions

      @NotNull public @NotNull List<Ollivanders2TeleportActions.O2TeleportAction> 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 teleporting
      from - the location they are teleporting from
      to - 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 teleporting
      from - the location they are teleporting from
      to - the location they are teleporting to
      explosionOnTeleport - 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