Add administrative override for /plot components

This commit is contained in:
NotMyFault 2021-05-21 17:54:26 +02:00
parent 17f91c8eb9
commit 93ff778de0
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
3 changed files with 8 additions and 2 deletions

View File

@ -189,6 +189,8 @@ permissions:
default: false default: false
plots.template: plots.template:
default: false default: false
plots.components:
default: false
plots.admin: plots.admin:
default: false default: false
@ -292,6 +294,8 @@ permissions:
default: false default: false
plots.admin.command.blocked-cmds.road: plots.admin.command.blocked-cmds.road:
default: false default: false
plots.admin.components.other:
default: false
plots.teleport.delay.bypass: plots.teleport.delay.bypass:
default: false default: false

View File

@ -33,6 +33,7 @@ import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.configuration.file.YamlConfiguration;
import com.plotsquared.core.configuration.serialization.ConfigurationSerialization; import com.plotsquared.core.configuration.serialization.ConfigurationSerialization;
import com.plotsquared.core.generator.ClassicPlotManagerComponent; import com.plotsquared.core.generator.ClassicPlotManagerComponent;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotInventory; import com.plotsquared.core.plot.PlotInventory;
@ -159,7 +160,7 @@ public class ComponentPresetManager {
} else if (!plot.hasOwner()) { } else if (!plot.hasOwner()) {
player.sendMessage(TranslatableCaption.of("info.plot_unowned")); player.sendMessage(TranslatableCaption.of("info.plot_unowned"));
return null; return null;
} else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID())) { } else if (!plot.isOwner(player.getUUID()) && !plot.getTrusted().contains(player.getUUID()) && !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_COMPONENTS_OTHER)) {
player.sendMessage(TranslatableCaption.of("permission.no_plot_perms")); player.sendMessage(TranslatableCaption.of("permission.no_plot_perms"));
return null; return null;
} else if (plot.getVolume() > Integer.MAX_VALUE) { } else if (plot.getVolume() > Integer.MAX_VALUE) {

View File

@ -202,7 +202,8 @@ public enum Permission {
PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe"), PERMISSION_ADMIN_ALLOW_UNSAFE("plots.admin.unsafe"),
PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other"), PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other"),
PERMISSION_RATE("plots.rate"), PERMISSION_RATE("plots.rate"),
PERMISSION_ADMIN_FLIGHT("plots.admin.flight"); PERMISSION_ADMIN_FLIGHT("plots.admin.flight"),
PERMISSION_ADMIN_COMPONENTS_OTHER("plots.admin.component.other");
//</editor-fold> //</editor-fold>
private final String text; private final String text;