Class CompletePortalManager

java.lang.Object
me.xxastaspastaxx.dimensions.completePortal.CompletePortalManager

public class CompletePortalManager extends Object
Manages all the complete portals
  • Constructor Details

    • CompletePortalManager

      public CompletePortalManager(Dimensions pl)
      Constructor of the manager
      Parameters:
      pl -
  • Method Details

    • getCompletePortals

      public ArrayList<CompletePortal> getCompletePortals()
      Get all the complete portals that have been built
      Returns:
      all the complete portals that have been built
    • getCompletePortal

      public CompletePortal getCompletePortal(org.bukkit.Location location, boolean outside, boolean corner)
      Get the complete portal that matches the location given
      Parameters:
      location - the location to check at
      outside - true to check if the location is at the frame of the portal
      corner - true to check if the location is at the corners of the portal
    • getCompletePortals

      public List<CompletePortal> getCompletePortals(org.bukkit.Location location, boolean outside, boolean corner)
      Get the complete portals that match the location given
      Parameters:
      location - the location to check at
      outside - true to check if the location is at the frame of the portals
      corner - true to check if the location is at the corners of the portals
    • getCompletePortals

      public ArrayList<CompletePortal> getCompletePortals(org.bukkit.World world)
      Get the complete portals in the given world
      Parameters:
      world - the world the check in
    • getCompletePortals

      public ArrayList<CompletePortal> getCompletePortals(org.bukkit.World world, int x, int z)
      Get the complete portals in the given world in the specific chunk
      Parameters:
      world - the world the check in
      x - chunk X
      z - chunk Z
    • getCompletePortals

      public ArrayList<CompletePortal> getCompletePortals(CustomPortal customPortal, org.bukkit.World world)
      Get the complete portals in the given world that are specific CustomPortal
      Parameters:
      customPortal - the type of the portal
      world - the world the check in
    • getCompletePortals

      public ArrayList<CompletePortal> getCompletePortals(CustomPortal customPortal)
      Get the complete portals that are specific CustomPortal
      Parameters:
      customPortal - the type of the portal
    • getNearestPortals

      public ArrayList<CompletePortal> getNearestPortals(org.bukkit.Location loc, int searchRadius)
      Get the nearest portals inside a radius
      Parameters:
      loc - the center of the search
      searchRadius - the radius
    • getNearestPortals

      public ArrayList<CompletePortal> getNearestPortals(org.bukkit.Location loc, int searchRadius, CustomPortal customPortal)
      Get the nearest portals inside a radius that are specific CustomPortal
      Parameters:
      loc - the center of the search
      searchRadius - the radius
      customPortal - the CustomPortal
    • getNearestPortal

      public CompletePortal getNearestPortal(org.bukkit.Location teleportLocation, CompletePortal sample, double ratio, boolean sameAxis, boolean sameSize, Predicate<CompletePortal> predicate)
      Get the nearest portal
      Parameters:
      teleportLocation - the cetner of the search
      sample - the portal to check for similarities
      ratio - the world ratio
      sameAxis - true to allow only portals with the same axis
      sameSize - true to allow only portals with the same size
      predicate - if it tests true, then the portal will be included in the search
    • getNearestPortal

      public CompletePortal getNearestPortal(org.bukkit.Location teleportLocation, CompletePortal sample, double ratio, boolean sameAxis, boolean sameSize)
      Get the nearest portal
      Parameters:
      teleportLocation - the cetner of the search
      sample - the portal to check for similarities
      ratio - the world ratio
      sameAxis - true to allow only portals with the same axis
      sameSize - true to allow only portals with the same size
    • createNew

      public CompletePortal createNew(CompletePortal completePortal, org.bukkit.entity.Entity igniter, CustomPortalIgniteCause cause, org.bukkit.inventory.ItemStack item)
      Register a new CompletePortal
      Parameters:
      completePortal - the portal to register
      igniter - the entity causing the ignite
      cause - the cause of the ignite
      item - the item used to ignite
      Returns:
      the complete portal THE COMPLETE PORTAL MIGHT DIFFERENT THAN THE PORTAL SUPPLIED
      See Also:
      CustomPortalIgniteEvent.replaceCompletePortal(CompletePortal)
    • removePortal

      public boolean removePortal(CompletePortal completePortal, CustomPortalDestroyCause cause, org.bukkit.entity.Entity destroyer)
      Unregister the complete portal
      Parameters:
      completePortal - the portal to remove
      cause - the cause of the removal
      destroyer - the entity causing the removel
      Returns:
      true if the portal was removed
    • save

      public void save()
      Save the portals
    • loadAll

      public void loadAll()
      Load the portals