From a95b68b73c87c465a6294d4e30cd47ee68f6fc76 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 9 Sep 2016 15:17:37 +1000 Subject: [PATCH] Add villager-interact flag --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 4 ++++ .../main/java/com/intellectualcrafters/plot/flag/Flags.java | 1 + 2 files changed, 5 insertions(+) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 792614bce..ccb723542 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -65,6 +65,7 @@ import org.bukkit.entity.TNTPrimed; import org.bukkit.entity.Tameable; import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.Vehicle; +import org.bukkit.entity.Villager; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -1966,6 +1967,9 @@ public class PlayerEvents extends PlotListener implements Listener { if (entity instanceof Player && plot.getFlag(Flags.PLAYER_INTERACT, false)) { return; } + if (entity instanceof Villager && plot.getFlag(Flags.VILLAGER_INTERACT, false)) { + return; + } if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_INTERACT_OTHER); event.setCancelled(true); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java index c740bc1b8..ec59d4e9e 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java @@ -68,6 +68,7 @@ public final class Flags { public static final BooleanFlag MISC_PLACE = new BooleanFlag("misc-place"); public static final BooleanFlag MISC_BREAK = new BooleanFlag("misc-break"); public static final BooleanFlag MISC_INTERACT = new BooleanFlag("misc-interact"); + public static final BooleanFlag VILLAGER_INTERACT = new BooleanFlag("villager-interact"); public static final BooleanFlag PLAYER_INTERACT = new BooleanFlag("player-interact"); public static final BooleanFlag TAMED_ATTACK = new BooleanFlag("tamed-attack"); public static final BooleanFlag TAMED_INTERACT = new BooleanFlag("tamed-interact");