Added //gmask to set a *GLOBAL* mask that affects nearly ALL operations. Now you can confine //sphere to a region or create //walls that do not replace existing blocks.

This commit is contained in:
sk89q
2011-06-04 12:16:10 -07:00
parent e1da7c41ad
commit aa17d2f0e0
4 changed files with 78 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import com.sk89q.minecraft.util.commands.CommandPermissions;
import com.sk89q.minecraft.util.commands.NestedCommand;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.blocks.ItemType;
import com.sk89q.worldedit.masks.Mask;
/**
* General WorldEdit commands.
@ -81,6 +82,27 @@ public class GeneralCommands {
}
}
@Command(
aliases = {"/gmask", "gmask"},
usage = "[mask]",
desc = "Set the global mask",
min = 0,
max = -1
)
@CommandPermissions({"worldedit.global-mask"})
public static void mask(CommandContext args, WorldEdit we,
LocalSession session, LocalPlayer player, EditSession editSession)
throws WorldEditException {
if (args.argsLength() == 0) {
session.setMask(null);
player.print("Global mask disabled.");
} else {
Mask mask = we.getBlockMask(player, session, args.getJoinedStrings(0));
session.setMask(mask);
player.print("Global mask set.");
}
}
@Command(
aliases = {"toggleplace"},
usage = "",