From a42e08dc0e75e093d7db62a400f770bbda649246 Mon Sep 17 00:00:00 2001 From: RedstoneFuture Date: Fri, 1 Nov 2024 12:05:33 +0100 Subject: [PATCH] Adding "entity-change-block" flag check for roads (#4527) Adding check for plot flag --- .../plotsquared/bukkit/listener/EntityEventListener.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java index 771738fb5..a2a5f1699 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java @@ -401,7 +401,13 @@ public class EntityEventListener implements Listener { } Plot plot = area.getOwnedPlot(location); - if (plot != null && !plot.getFlag(EntityChangeBlockFlag.class)) { + if (plot == null) { + if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, EntityChangeBlockFlag.class, false)) { + event.setCancelled(true); + } + return; + } + if (!plot.getFlag(EntityChangeBlockFlag.class)) { plot.debug(e.getType() + " could not change block because entity-change-block = false"); event.setCancelled(true); }