This commit is contained in:
Jesse Boyd 2017-03-14 01:56:14 +11:00
parent 491cc50440
commit 411c75b219
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -517,28 +517,28 @@ public class MainListener {
if (plot == null) { if (plot == null) {
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_ROAD, true)) { if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_ROAD, true)) {
event.setCancelled(true); event.setCancelled(true);
return;
} }
if (plot.hasOwner()) { return;
if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) { }
return; if (plot.hasOwner()) {
} else { if (plot.isAdded(pp.getUUID()) || Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_OTHER)) {
com.google.common.base.Optional<HashSet<PlotBlock>> place = plot.getFlag(Flags.PLACE); return;
BlockState state = first.getBlock();
if (!place.isPresent() || !place.get().contains(SpongeUtil.getPlotBlock(state))) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER);
event.setCancelled(true);
return;
}
}
} else { } else {
if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_UNOWNED)) { com.google.common.base.Optional<HashSet<PlotBlock>> place = plot.getFlag(Flags.PLACE);
BlockState state = first.getBlock();
if (!place.isPresent() || !place.get().contains(SpongeUtil.getPlotBlock(state))) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_OTHER);
event.setCancelled(true);
return; return;
} }
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_UNOWNED); }
event.setCancelled(true); } else {
if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_BUILD_UNOWNED)) {
return; return;
} }
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_BUILD_UNOWNED);
event.setCancelled(true);
return;
} }
} }