Class RedProtectAPI
java.lang.Object
br.net.fabiozumbi12.RedProtect.Bukkit.API.RedProtectAPI
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd custom flags.voidAdd a region.Return all regions for all loaded worlds;getChunkRegions(org.bukkit.Chunk chunk) Return all regions present on provided chunk, including low and hight priority.getGroupRegions(org.bukkit.Location loc) The group of Regions on given location x and z.getGroupRegions(org.bukkit.World world, int x, int y, int z) The group of Regions on given location x and z.getHighPriorityRegion(org.bukkit.World world, int x, int y, int z) In a location with more than one region, use to get the upper region with high priority.getLowPriorityRegion(org.bukkit.World world, int x, int y, int z) In a location with more than one region, use to get the lower region with low priority.Return language api to send messages using RedProtect language;getPlayerRegions(String uuid) A set of regions created by this player based on uuid or player name.getPlayerRegions(String uuid, org.bukkit.World world) A set of regions created by this player based on uuid or player name and specific world.getPlayerRegions(org.bukkit.entity.Player player) A set of regions created by this player.getPlayerRegions(org.bukkit.entity.Player player, int x, int y, int z) A set of regions created by this player based on x and z.Give the Region based on given name and world.getRegion(org.bukkit.Location location) Return the Region on location.booleanremoveFlag(String flag, boolean isAdmin) voidremoveRegion(Region region) Remove a region.voidrenameRegion(Region region, String newName) Rename a region;
-
Constructor Details
-
RedProtectAPI
public RedProtectAPI()
-
-
Method Details
-
getMessageApi
Return language api to send messages using RedProtect language;- Returns:
LangManagerwith language api.
-
getAllRegions
Return all regions for all loaded worlds;- Returns:
Set<Region>with all regions. Empty list if no regions.
-
getRegion
Give the Region based on given name and world.- Parameters:
regionName- Region Name.world- World where this Region is.- Returns:
Regionmatching the name ornullif region not found.
-
getRegion
Return the Region on location.*Note: If theres more region in this same location this method will return only the high priority region. To get all possible region in one location use
getGroupRegions()- Parameters:
location- Player location.- Returns:
Regionof location ornullif no regions on player location.
-
getPlayerRegions
A set of regions created by this player based on uuid or player name.- Parameters:
uuid- The uuid of player in String format! Make a way to give player name for servers using 'offline mode'.- Returns:
set<Region>with all regions created by given player.
-
getPlayerRegions
A set of regions created by this player based on uuid or player name and specific world.- Parameters:
uuid- The uuid of player in String format! Make a way to give player name for servers using 'offline mode'.world- to search for given region.- Returns:
set<Region>with all regions created by given player.
-
getPlayerRegions
A set of regions created by this player.- Parameters:
player- The player.- Returns:
set<Region>with all regions created by given player.
-
getPlayerRegions
A set of regions created by this player based on x and z.- Parameters:
player- Owner of regions.x- Coord x of a location.y- Coord y of a location.z- Coord z of a location.- Returns:
set<Region>with all regions created by given player.
-
getHighPriorityRegion
In a location with more than one region, use to get the upper region with high priority.- Parameters:
world- World to search for regions.x- Coord x of a location.y- Coord y of a location.z- Coord z of a location.- Returns:
- The high priority
Regionin a group of regions.
-
getLowPriorityRegion
In a location with more than one region, use to get the lower region with low priority.- Parameters:
world- World to search for regions.x- Coord x of a location.y- Coord y of a location.z- Coord z of a location.- Returns:
- The lower priority
Regionin a group of regions.
-
getGroupRegions
The group of Regions on given location x and z.- Parameters:
world- World to search for regions.x- Coord x of a location.y- Coord y of a location.z- Coord z of a location.- Returns:
Map<Integer, Region>withIntegeras priority and the correspondingRegion.
-
getGroupRegions
The group of Regions on given location x and z.- Parameters:
loc-Locationto check the regions- Returns:
Map<Integer, Region>withIntegeras priority and the correspondingRegion.
-
getChunkRegions
Return all regions present on provided chunk, including low and hight priority.- Parameters:
chunk- Chunk to get Regions.- Returns:
Set<Region>with all regions on provided chunk.
-
addRegion
Add a region.- Parameters:
region-Regionto add.world-WorldofRegionto add.
-
removeRegion
Remove a region.- Parameters:
region-Regionto remove.
-
renameRegion
Rename a region;- Parameters:
region- Region to rename.newName- New name of region;
-
addFlag
Add custom flags.- Parameters:
flag- The name of flag.defaultValue- Default value if not admin flag.isAdmin- Is flag admin? If admin, will require admin permission (redprotect.admin.flag.FlagName)- Returns:
- true if added or false if the flag already exists.
-
removeFlag
- Parameters:
flag- The name of flag.isAdmin- Is Admin flag?- Returns:
- true if the flag was found and has been removed, false otherwise.
-