feat: Add worldedit.schematic.save.global permission (#1406)

Dieser Commit ist enthalten in:
Desjardins Jérôme 2021-11-12 15:21:06 +01:00 committet von GitHub
Ursprung 6f33c5223d
Commit a2df590fae
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -416,7 +416,7 @@ public class SchematicCommands {
name = "save", name = "save",
desc = "Save your clipboard into a schematic file" desc = "Save your clipboard into a schematic file"
) )
@CommandPermissions({"worldedit.clipboard.save", "worldedit.schematic.save", "worldedit.schematic.save.other"}) @CommandPermissions({"worldedit.clipboard.save", "worldedit.schematic.save", "worldedit.schematic.save.other", "worldedit.schematic.save.global"})
public void save( public void save(
Actor actor, LocalSession session, Actor actor, LocalSession session,
@Arg(desc = "File name.") @Arg(desc = "File name.")
@ -429,6 +429,12 @@ public class SchematicCommands {
@Switch(name = 'g', desc = "Bypasses per-player-schematic folders") @Switch(name = 'g', desc = "Bypasses per-player-schematic folders")
boolean global boolean global
) throws WorldEditException { ) throws WorldEditException {
if (global && !actor.hasPermission("worldedit.schematic.save.global")) {
actor.print(Caption.of("fawe.error.no-perm", "worldedit.schematic.save.global"));
return;
}
//FAWE end //FAWE end
if (worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getDataVersion() == -1) { if (worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getDataVersion() == -1) {
actor.print(TranslatableComponent.of("worldedit.schematic.unsupported-minecraft-version")); actor.print(TranslatableComponent.of("worldedit.schematic.unsupported-minecraft-version"));