Class APPARATE

java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.APPARATE

public final class APPARATE extends O2Spell
Apparition code for players who have over 100 uses in apparition.
  • Field Details

    • maxApparateDistance

      public static int maxApparateDistance
      The maximum apparate distance, value less than or equal 0 means no limit
  • Constructor Details

    • APPARATE

      public APPARATE(Ollivanders2 plugin)
      Default constructor for use in generating spell text. Do not use to cast the spell.
      Parameters:
      plugin - the Ollivanders2 plugin
    • APPARATE

      public APPARATE(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Double rightWand, @NotNull @NotNull String[] wordsArray)
      Constructor.
      Parameters:
      plugin - a callback to the MC plugin
      player - the player who cast this spell
      rightWand - which wand the player was using
      wordsArray - the arguments to the apparate spell
  • Method Details

    • checkEffect

      public void checkEffect()
      Teleport the caster to the location, or close to it, depending on skill level
      Overrides:
      checkEffect in class O2Spell
    • listApparateLocations

      public static void listApparateLocations(@NotNull @NotNull org.bukkit.entity.Player player)
      List all apparate locations
      Parameters:
      player - player to display the list to
    • addLocation

      public static boolean addLocation(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.World world, double x, double y, double z)
      Add an apparate location
      Parameters:
      name - the name of the location to add
      world - the location world
      x - x-coordinate
      y - y-coordinate
      z - z-coordinate
      Returns:
      true if successfully added, false otherwise
    • removeLocation

      public static void removeLocation(@NotNull @NotNull String name)
      Remove an apparate location
      Parameters:
      name - the name of the location to remove
    • doesLocationExist

      public static boolean doesLocationExist(@NotNull @NotNull String name)
      Check if a named apparate location exists.
      Parameters:
      name - the location name
      Returns:
      true if it exists in the list, false otherwise
    • getLocationByName

      @Nullable public @Nullable org.bukkit.Location getLocationByName(@NotNull @NotNull String name)
      Return an apparate location by name
      Parameters:
      name - the location name
      Returns:
      the location if found, null otherwise
    • getAllApparateLocations

      @NotNull public static @NotNull Map<String,org.bukkit.Location> getAllApparateLocations()
      Return a map of all apparate locations
      Returns:
      a map of all apparate locations
    • clearApparateLocations

      public static void clearApparateLocations()
      Clears all apparate locations
    • saveApparateLocations

      public static void saveApparateLocations()
      Save all apparate locations
    • loadApparateLocations

      public static void loadApparateLocations(Ollivanders2 p)
      Load all saved apparate locations
      Parameters:
      p - a callback to the plugin
    • doCheckEffect

      protected void doCheckEffect()
      Description copied from class: O2Spell
      Spell-specific effects and behavior executed each game tick.

      Called each tick from O2Spell.checkEffect() after validation and movement logic. Subclasses must override this method to implement the spell's unique effects such as damage, block changes, particle effects, or other gameplay mechanics.

      Specified by:
      doCheckEffect in class O2Spell