Package net.pottercraft.ollivanders2
Class Ollivanders2WorldGuard
java.lang.Object
net.pottercraft.ollivanders2.Ollivanders2WorldGuard
Handles all WorldGuard support for Ollivanders2. If WorldGuard is not enabled on the server, all calls
will short circuit to allow actions.
- Since:
- 2.2.5
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckWGBuild(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location location) If WorldGuard is enabled, determine if the player has build permissions.booleancheckWGFlag(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location location, @NotNull com.sk89q.worldguard.protection.flags.StateFlag flag) If WorldGuard is enabled, determine if player is allowed a specific permission.@Nullable com.sk89q.worldguard.protection.ApplicableRegionSetgetWGRegionSet(@NotNull org.bukkit.Location location) Get the regions in this location.booleanisLocationInRegionByName(String regionName, org.bukkit.Location location) Determine if a location is in a region by name
-
Constructor Details
-
Ollivanders2WorldGuard
Constructor.- Parameters:
o2plugin- a callback to the ollivanders plugin- See Also:
-
-
Method Details
-
getWGRegionSet
@Nullable public @Nullable com.sk89q.worldguard.protection.ApplicableRegionSet getWGRegionSet(@NotNull @NotNull org.bukkit.Location location) Get the regions in this location.- Parameters:
location- the locationto check- Returns:
- the set of regions for this location or null if there is no set.
-
checkWGFlag
public boolean checkWGFlag(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull com.sk89q.worldguard.protection.flags.StateFlag flag) If WorldGuard is enabled, determine if player is allowed a specific permission. This is done so that Ollivanders2 actions do not complete partially, such as mob transfiguration spells, and then cannot complete because WorldGuard is enabled.- Parameters:
player- the player to check forlocation- the location to check (since it may not be where the player is)flag- the flag to check- Returns:
- true if the player has this permission at this location, false otherwise
-
checkWGBuild
public boolean checkWGBuild(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location location) If WorldGuard is enabled, determine if the player has build permissions. This is done so that Ollivanders2 actions do not complete partially, such as object transformation spells, and then cannot complete because WorldGuard is enabled.- Parameters:
player- the player to check WG forlocation- the location to check (since it may not be where the player is)- Returns:
- true if the player has permissions to build at their location, false otherwise
-
isLocationInRegionByName
Determine if a location is in a region by name- Parameters:
regionName- the name of the region to checklocation- the location to check- Returns:
- true if it is inside a region with this name, false otherwise
-