From 2435d70236b9effd6d47eb0098cba3f7608d79b7 Mon Sep 17 00:00:00 2001 From: Brianna Date: Thu, 25 Feb 2021 11:46:47 -0600 Subject: [PATCH] Added quick access to the build flag. --- .../java/com/songoda/core/hooks/WorldGuardHook.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Core/src/main/java/com/songoda/core/hooks/WorldGuardHook.java b/Core/src/main/java/com/songoda/core/hooks/WorldGuardHook.java index 54de756f..770fcd10 100644 --- a/Core/src/main/java/com/songoda/core/hooks/WorldGuardHook.java +++ b/Core/src/main/java/com/songoda/core/hooks/WorldGuardHook.java @@ -91,6 +91,16 @@ public class WorldGuardHook { return canHook && Objects.equals(WorldGuardFlagHandler.getBooleanFlag(loc, "block-break"), Boolean.TRUE); } + /** + * Check to see if the build flag is set and is set to ALLOW + * + * @param loc Location to check + * @return false if the build flag is not set for this region, or is set to DENY + */ + public static boolean isBuildAllowed(@NotNull Location loc) { + return canHook && Objects.equals(WorldGuardFlagHandler.getBooleanFlag(loc, "build"), Boolean.TRUE); + } + /** * Check to see if the use flag is set and is set to ALLOW *