Class CompletePortalManager
java.lang.Object
me.xxastaspastaxx.dimensions.completePortal.CompletePortalManager
Manages all the complete portals
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateNew(CompletePortal completePortal, org.bukkit.entity.Entity igniter, CustomPortalIgniteCause cause, org.bukkit.inventory.ItemStack item)
Register a new CompletePortalgetCompletePortal(org.bukkit.Location location, boolean outside, boolean corner)
Get the complete portal that matches the location givenGet all the complete portals that have been builtgetCompletePortals(CustomPortal customPortal)
Get the complete portals that are specific CustomPortalgetCompletePortals(CustomPortal customPortal, org.bukkit.World world)
Get the complete portals in the given world that are specific CustomPortalgetCompletePortals(org.bukkit.Location location, boolean outside, boolean corner)
Get the complete portals that match the location givengetCompletePortals(org.bukkit.World world)
Get the complete portals in the given worldgetCompletePortals(org.bukkit.World world, int x, int z)
Get the complete portals in the given world in the specific chunkgetNearestPortal(org.bukkit.Location teleportLocation, CompletePortal sample, double ratio, boolean sameAxis, boolean sameSize)
Get the nearest portalgetNearestPortal(org.bukkit.Location teleportLocation, CompletePortal sample, double ratio, boolean sameAxis, boolean sameSize, Predicate<CompletePortal> predicate)
Get the nearest portalgetNearestPortals(org.bukkit.Location loc, int searchRadius)
Get the nearest portals inside a radiusgetNearestPortals(org.bukkit.Location loc, int searchRadius, CustomPortal customPortal)
Get the nearest portals inside a radius that are specific CustomPortalvoid
loadAll()
Load the portalsboolean
removePortal(CompletePortal completePortal, CustomPortalDestroyCause cause, org.bukkit.entity.Entity destroyer)
Unregister the complete portalvoid
save()
Save the portals
-
Constructor Details
-
CompletePortalManager
Constructor of the manager- Parameters:
pl
-
-
-
Method Details
-
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 atoutside
- true to check if the location is at the frame of the portalcorner
- 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 atoutside
- true to check if the location is at the frame of the portalscorner
- true to check if the location is at the corners of the portals
-
getCompletePortals
Get the complete portals in the given world- Parameters:
world
- the world the check in
-
getCompletePortals
Get the complete portals in the given world in the specific chunk- Parameters:
world
- the world the check inx
- chunk Xz
- 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 portalworld
- the world the check in
-
getCompletePortals
Get the complete portals that are specific CustomPortal- Parameters:
customPortal
- the type of the portal
-
getNearestPortals
Get the nearest portals inside a radius- Parameters:
loc
- the center of the searchsearchRadius
- 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 searchsearchRadius
- the radiuscustomPortal
- 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 searchsample
- the portal to check for similaritiesratio
- the world ratiosameAxis
- true to allow only portals with the same axissameSize
- true to allow only portals with the same sizepredicate
- 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 searchsample
- the portal to check for similaritiesratio
- the world ratiosameAxis
- true to allow only portals with the same axissameSize
- 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 registerigniter
- the entity causing the ignitecause
- the cause of the igniteitem
- 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 removecause
- the cause of the removaldestroyer
- 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
-