public interface IslandsContainer
Modifier and Type | Method and Description |
---|---|
void |
addIsland(Island island)
Add an island to the islands container.
|
void |
addSortingType(SortingType sortingType,
boolean sort)
Add a new sorting-type.
|
Island |
getIslandAt(org.bukkit.Location location)
Get an island at a location.
|
Island |
getIslandAtPosition(int position,
SortingType sortingType)
Get an island by its position in the top-islands.
|
Island |
getIslandByLeader(java.util.UUID uuid)
Get an island by its leader's uuid.
|
Island |
getIslandByUUID(java.util.UUID uuid)
Get an island by its uuid.
|
int |
getIslandPosition(Island island,
SortingType sortingType)
Get the position of an island in the top-islands.
|
int |
getIslandsAmount()
Get the amount of islands on the server.
|
java.util.List<Island> |
getIslandsUnsorted()
Get all islands.
|
java.util.List<Island> |
getSortedIslands(SortingType sortingType)
Get all islands sorted by a specific sorting-type.
|
void |
removeIsland(Island island)
Remove an island from the islands container.
|
void |
sortIslands(SortingType sortingType,
boolean forceSort,
java.lang.Runnable onFinish)
Sort islands for the top-islands.
|
void |
sortIslands(SortingType sortingType,
java.lang.Runnable onFinish)
Sort islands for the top-islands.
|
void |
transferIsland(java.util.UUID oldLeader,
java.util.UUID newLeader)
Transfer an island from a player to another one.
|
void addIsland(Island island)
island
- The island to add.void removeIsland(Island island)
island
- The island to remove.@Nullable Island getIslandByUUID(java.util.UUID uuid)
uuid
- The uuid of the island.@Nullable Island getIslandByLeader(java.util.UUID uuid)
uuid
- The uuid of the island's leader.@Nullable Island getIslandAtPosition(int position, SortingType sortingType)
position
- The position of the island.sortingType
- The sorting-type to get islands from.int getIslandPosition(Island island, SortingType sortingType)
island
- The island to get position of.sortingType
- The sorting-type to get islands from.int getIslandsAmount()
@Nullable Island getIslandAt(org.bukkit.Location location)
location
- The location to get island in.void transferIsland(java.util.UUID oldLeader, java.util.UUID newLeader)
Island.transferIsland(SuperiorPlayer)
.oldLeader
- The uuid of the current leader.newLeader
- The uuid of the new leader.void sortIslands(SortingType sortingType, @Nullable java.lang.Runnable onFinish)
sortingType
- The type of sorting to use.onFinish
- Callback methodvoid sortIslands(SortingType sortingType, boolean forceSort, @Nullable java.lang.Runnable onFinish)
sortingType
- The type of sorting to use.forceSort
- Whether to force-sort the islands.
When true, islands will get sorted even if only one island exists.onFinish
- Callback methodjava.util.List<Island> getSortedIslands(SortingType sortingType)
sortingType
- The type of sorting to use.java.util.List<Island> getIslandsUnsorted()
void addSortingType(SortingType sortingType, boolean sort)
sortingType
- The sorting-type to add.sort
- Whether to sort the islands or not when the sorting-type is added.