Skip to content

Commit

Permalink
add admin permission override to edit signs
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell committed Jan 3, 2024
1 parent ead7acd commit b64db18
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.plotsquared.bukkit.util.BukkitUtil;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.implementations.EditSignFlag;
Expand All @@ -46,15 +47,17 @@ public void onPlayerSignOpenEvent(PlayerSignOpenEvent event) {
}
Plot plot = location.getOwnedPlot();
if (plot == null) {
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, EditSignFlag.class, false)) {
if (PlotFlagUtil.isAreaRoadFlagsAndFlagEquals(area, EditSignFlag.class, false)
&& !event.getPlayer().hasPermission(Permission.PERMISSION_ADMIN_INTERACT_ROAD.toString())) {
event.setCancelled(true);
}
return;
}
if (plot.isAdded(event.getPlayer().getUniqueId())) {
return; // allow for added players
}
if (!plot.getFlag(EditSignFlag.class)) {
if (!plot.getFlag(EditSignFlag.class)
&& !event.getPlayer().hasPermission(Permission.PERMISSION_ADMIN_INTERACT_OTHER.toString())) {
plot.debug(event.getPlayer().getName() + " could not edit the sign because of edit-sign = false");
event.setCancelled(true);
}
Expand Down

0 comments on commit b64db18

Please sign in to comment.