From 70f0814292400f001ff59f379f8a382b11c55f56 Mon Sep 17 00:00:00 2001 From: Petrus Date: Thu, 27 Dec 2018 19:57:13 -0200 Subject: [PATCH] Add support for Modded entities (non Hostile|Animal|Tamed|Veichle|Player|Villager|Misc entity) --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 3 +++ .../main/java/com/intellectualcrafters/plot/flag/Flags.java | 1 + 2 files changed, 4 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 972c26dfe..08bb947c3 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -2244,6 +2244,9 @@ public class PlayerEvents extends PlotListener implements Listener { } } else if (!plot.isAdded(pp.getUUID())) { Entity entity = event.getRightClicked(); + if (entity instanceof Creature && plot.getFlag(Flags.CREATURE_INTERACT, false)) { + return; + } if (entity instanceof Monster && plot.getFlag(Flags.HOSTILE_INTERACT, false)) { return; } 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 5e46db04c..005005d63 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java @@ -79,6 +79,7 @@ public final class Flags { public static final BooleanFlag ANIMAL_INTERACT = new BooleanFlag("animal-interact"); public static final BooleanFlag HOSTILE_ATTACK = new BooleanFlag("hostile-attack"); public static final BooleanFlag HOSTILE_INTERACT = new BooleanFlag("hostile-interact"); + public static final BooleanFlag CREATURE_INTERACT = new BooleanFlag("creature-interact"); public static final BooleanFlag MOB_PLACE = new BooleanFlag("mob-place"); public static final BooleanFlag MOB_BREAK = new BooleanFlag("mob-break"); public static final BooleanFlag FORCEFIELD = new BooleanFlag("forcefield");