Added UseFlag check at Roads

This commit is contained in:
Timon 2020-08-06 12:01:43 +02:00
parent 01d2b0024f
commit c745b99922

View File

@ -279,6 +279,12 @@ public class EventDispatcher {
return true; return true;
case INTERACT_BLOCK: { case INTERACT_BLOCK: {
if (plot == null) { if (plot == null) {
final List<BlockTypeWrapper> use = area.getRoadFlag(UseFlag.class);
for(final BlockTypeWrapper blockTypeWrapper : use) {
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper.accepts(blockType)) {
return true;
}
}
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms); Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms);
} }
@ -301,6 +307,12 @@ public class EventDispatcher {
} }
case TRIGGER_PHYSICAL: { case TRIGGER_PHYSICAL: {
if (plot == null) { if (plot == null) {
final List<BlockTypeWrapper> use = area.getRoadFlag(UseFlag.class);
for(final BlockTypeWrapper blockTypeWrapper : use) {
if (blockTypeWrapper.accepts(BlockTypes.AIR) || blockTypeWrapper.accepts(blockType)) {
return true;
}
}
return Permissions.hasPermission(player, return Permissions.hasPermission(player,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), false); Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), false);
} }