Adding "entity-change-block" flag check for roads (#4527)

Adding check for plot flag
This commit is contained in:
RedstoneFuture 2024-11-01 12:05:33 +01:00 committed by GitHub
parent 10bf45c128
commit a42e08dc0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -401,7 +401,13 @@ public class EntityEventListener implements Listener {
} }
Plot plot = area.getOwnedPlot(location); 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"); plot.debug(e.getType() + " could not change block because entity-change-block = false");
event.setCancelled(true); event.setCancelled(true);
} }