mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
feat: Add worldedit.schematic.save.global permission (#1406)
This commit is contained in:
parent
6f33c5223d
commit
a2df590fae
@ -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"));
|
||||||
|
Loading…
Reference in New Issue
Block a user