Package net.dzikoysk.funnyguilds.guild
Class RegionManager
java.lang.Object
net.dzikoysk.funnyguilds.guild.RegionManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd region to storage.voidDeletes all loaded regions dataintvoiddeleteRegion(DataModel dataModel, Region region) Deprecated.for removal in the future with database rework (GH-1402)panda.std.Option<Region>findByName(String name) Gets the region.panda.std.Option<Region>findByName(String name, boolean ignoreCase) Gets the region.panda.std.Option<Region>findRegionAtLocation(org.bukkit.Location location) Gets the region.Gets the copied set of regions.booleanisAnyPlayerInRegion(Region region) booleanisAnyPlayerInRegion(Region region, Collection<UUID> ignoredUuids) booleanisAnyUserInRegion(Region region, Collection<User> ignoredUsers) booleanisAnyUserInRegion(panda.std.Option<Region> regionOption, Collection<User> ignoredUsers) booleanisGuildHeart(org.bukkit.block.Block block) Checks if given block is guild's heart.booleanisInRegion(org.bukkit.Location location) Checks if there is a region in the given location.booleanisNearRegion(org.bukkit.Location center) Checks if there is any region in area (used to check if it's possible to create a new guild in given location).booleanisNearRegion(panda.std.Option<org.bukkit.Location> center) booleanregionExists(String name) Checks if region with given name exists.voidremoveRegion(Region region) Remove region from storage.
-
Constructor Details
-
RegionManager
-
-
Method Details
-
countRegions
public int countRegions() -
getRegions
Gets the copied set of regions.- Returns:
- set of regions
-
clearRegions
public void clearRegions()Deletes all loaded regions data -
findByName
Gets the region.- Parameters:
name- the name of region (probably name of guild)ignoreCase- ignore the case of the tag- Returns:
- the guild
-
findByName
Gets the region.- Parameters:
name- the name of region (probably name of guild)- Returns:
- the region
-
findRegionAtLocation
Gets the region.- Parameters:
location- the location of region- Returns:
- the region
-
isInRegion
public boolean isInRegion(org.bukkit.Location location) Checks if there is a region in the given location.- Parameters:
location- the location of region- Returns:
- if given location is in region
-
isAnyPlayerInRegion
-
isAnyPlayerInRegion
-
isAnyUserInRegion
-
isAnyUserInRegion
public boolean isAnyUserInRegion(panda.std.Option<Region> regionOption, Collection<User> ignoredUsers) -
isNearRegion
public boolean isNearRegion(org.bukkit.Location center) Checks if there is any region in area (used to check if it's possible to create a new guild in given location).- Parameters:
center- the center of region- Returns:
- if is region nearby
-
isNearRegion
public boolean isNearRegion(panda.std.Option<org.bukkit.Location> center) -
isGuildHeart
public boolean isGuildHeart(org.bukkit.block.Block block) Checks if given block is guild's heart.- Parameters:
block- block to check- Returns:
- if given block is guild's heart
-
addRegion
Add region to storage. If you think you should use this method you probably shouldn't.- Parameters:
region- region to add
-
removeRegion
Remove region from storage. If you think you should use this method you probably shouldn't - instead usedeleteRegion(DataModel, Region).- Parameters:
region- region to remove
-
deleteRegion
@Deprecated @ScheduledForRemoval(inVersion="5.0") public void deleteRegion(DataModel dataModel, Region region) Deprecated.for removal in the future with database rework (GH-1402)Delete region from storage and from database.- Parameters:
region- region to delete
-
regionExists
Checks if region with given name exists.- Parameters:
name- region name- Returns:
- if region exists
-