From 592ef42741e521546665db3fc49137f2b22c9273 Mon Sep 17 00:00:00 2001 From: isokissa3 Date: Tue, 11 Dec 2018 02:50:28 +0200 Subject: [PATCH] Make NPCs bypass all flags, closes #41 --- .../worldguardextraflags/wg/WorldGuardUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java b/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java index bec2aa1..ee51951 100644 --- a/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java +++ b/WG/src/main/java/net/goldtreeservers/worldguardextraflags/wg/WorldGuardUtils.java @@ -38,6 +38,11 @@ public class WorldGuardUtils public static boolean hasBypass(Player player, World world, ProtectedRegion region, Flag flag) { + if (player.hasMetadata("NPC")) + { + return true; + } + //Permission system that supports wildcars is really helpful here :) if (player.hasPermission("worldguard.region.bypass." + world.getName() + "." + region.getId() + "." + flag.getName())) {