Class Ollivanders2WorldGuard

java.lang.Object
net.pottercraft.ollivanders2.Ollivanders2WorldGuard

public class Ollivanders2WorldGuard extends Object
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
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkWGBuild(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location location)
    If WorldGuard is enabled, determine if the player has build permissions.
    boolean
    checkWGFlag(@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.ApplicableRegionSet
    getWGRegionSet(@NotNull org.bukkit.Location location)
    Get the regions in this location.
    boolean
    isLocationInRegionByName(String regionName, org.bukkit.Location location)
    Determine if a location is in a region by name

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 for
      location - 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 for
      location - 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

      public boolean isLocationInRegionByName(String regionName, org.bukkit.Location location)
      Determine if a location is in a region by name
      Parameters:
      regionName - the name of the region to check
      location - the location to check
      Returns:
      true if it is inside a region with this name, false otherwise