Class WorldAreaFactory
java.lang.Object
me.nurio.minecraft.worldareas.areas.WorldAreaFactory
WorldAreaFactory manages active world areas, listing, search, etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWorldArea(@NotNull WorldArea area) Registers a new world area to the list of world areas.fromLocation(@NotNull org.bukkit.Location location) Obtains a world area instance from location.@Nullable WorldAreaObtains a world area instance from his UUID.booleanisAnyWorldAreaAt(@NotNull org.bukkit.Location location) Checks if there is any world area at provided location
-
Constructor Details
-
WorldAreaFactory
public WorldAreaFactory()
-
-
Method Details
-
addWorldArea
Registers a new world area to the list of world areas.- Parameters:
area- World area to register.
-
fromLocation
@NotNull public @NotNull List<WorldArea> fromLocation(@NotNull @NotNull org.bukkit.Location location) Obtains a world area instance from location.- Parameters:
location- Location to check if there are any world area.- Returns:
- List of WorldArea instances in case of any. Empty list otherwise.
-
fromUuid
Obtains a world area instance from his UUID.- Parameters:
uuid- WorldArea UUID- Returns:
- WorldArea instance or null in case there is no matching area.
-
isAnyWorldAreaAt
public boolean isAnyWorldAreaAt(@NotNull @NotNull org.bukkit.Location location) Checks if there is any world area at provided location. - Take care with calling this method before #fromLocation() that will be a performance waste.- Parameters:
location- Location to check if there are any world area.- Returns:
- true in case there is any world area, false otherwise.
-