Skip to content

Commit a42e08d

Browse files
Adding "entity-change-block" flag check for roads (#4527)
Adding check for plot flag
1 parent 10bf45c commit a42e08d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntityEventListener.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,13 @@ public void onPeskyMobsChangeTheWorldLikeWTFEvent(EntityChangeBlockEvent event)
401401
}
402402

403403
Plot plot = area.getOwnedPlot(location);
404-
if (plot != null && !plot.getFlag(EntityChangeBlockFlag.class)) {
404+
if (plot == null) {
405+
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, EntityChangeBlockFlag.class, false)) {
406+
event.setCancelled(true);
407+
}
408+
return;
409+
}
410+
if (!plot.getFlag(EntityChangeBlockFlag.class)) {
405411
plot.debug(e.getType() + " could not change block because entity-change-block = false");
406412
event.setCancelled(true);
407413
}

0 commit comments

Comments
 (0)