Add /center commmand

This commit is contained in:
aumgn
2012-08-29 10:00:26 +02:00
parent c759b9062c
commit 7fd5d1b61c
6 changed files with 53 additions and 0 deletions

View File

@ -144,6 +144,22 @@ public class RegionCommands {
player.print(affected + " block(s) have been overlayed.");
}
@Command(
aliases = { "/center", "/middle" },
usage = "<block>",
desc = "Set the center block(s)",
min = 1,
max = 1
)
public void center(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
Pattern pattern = we.getBlockPattern(player, args.getString(0));
Region region = session.getSelection(player.getWorld());
int affected = editSession.center(region, pattern);
player.print("Center set ("+ affected + " blocks changed)");
}
@Command(
aliases = { "/naturalize" },
usage = "",