From c745b99922a88e6c93fe6924eff0a5cec9c3113a Mon Sep 17 00:00:00 2001 From: Timon Date: Thu, 6 Aug 2020 12:01:43 +0200 Subject: [PATCH] Added UseFlag check at Roads --- .../com/plotsquared/core/util/EventDispatcher.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java b/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java index 23d5dd15f..b495fb212 100644 --- a/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java +++ b/Core/src/main/java/com/plotsquared/core/util/EventDispatcher.java @@ -279,6 +279,12 @@ public class EventDispatcher { return true; case INTERACT_BLOCK: { if (plot == null) { + final List use = area.getRoadFlag(UseFlag.class); + for(final BlockTypeWrapper blockTypeWrapper : use) { + if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper.accepts(blockType)) { + return true; + } + } return Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms); } @@ -301,6 +307,12 @@ public class EventDispatcher { } case TRIGGER_PHYSICAL: { if (plot == null) { + final List use = area.getRoadFlag(UseFlag.class); + for(final BlockTypeWrapper blockTypeWrapper : use) { + if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper.accepts(blockType)) { + return true; + } + } return Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), false); }