Skip to content

Commit

Permalink
Adding "entity-change-block" flag check for roads (#4527)
Browse files Browse the repository at this point in the history
Adding check for plot flag
  • Loading branch information
RedstoneFuture authored Nov 1, 2024
1 parent 10bf45c commit a42e08d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,13 @@ public void onPeskyMobsChangeTheWorldLikeWTFEvent(EntityChangeBlockEvent event)
}

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);
}
Expand Down

0 comments on commit a42e08d

Please sign in to comment.