Added UseFlag check at Roads

This commit is contained in:
Timon 2020-08-06 12:01:43 +02:00 committed by dordsor21
parent 01d2b0024f
commit dc3f45acd4

View File

@ -279,6 +279,12 @@ public class EventDispatcher {
return true;
case INTERACT_BLOCK: {
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,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms);
}
@ -301,6 +307,12 @@ public class EventDispatcher {
}
case TRIGGER_PHYSICAL: {
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,
Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), false);
}